Skip to content

Commit 74b801b

Browse files
author
jcob
committed
update model
1 parent 6e3deaf commit 74b801b

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

server/djangoapp/models.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@
2525
# - Year (IntegerField) with min value 2015 and max value 2023
2626
# - Any other fields you would like to include in car model
2727
# - __str__ method to print a car make object
28-
class CarMake(models.Model):
29-
name = models.CharField(max_length=100)
30-
description = models.TextField()
31-
# Other fields as needed
32-
33-
def __str__(self):
34-
return self.name # Return the name as the string representation
35-
3628

37-
class CarModel(models.Model):
38-
car_make = models.ForeignKey(CarMake, on_delete=models.CASCADE) #Many-to-One relationship
39-
name = models.CharField(max_length=100)
40-
CAR_TYPES = [
41-
('SEDAN', 'Sedan'),
42-
('SUV', 'SUV'),
43-
('WAGON', 'Wagon'),
29+
#class CarMake(models.Model):
30+
# name = models.CharField(max_length=100)
31+
# description = models.TextField()
32+
# # Other fields as needed
33+
34+
# def __str__(self):
35+
# return self.name # Return the name as the string representation
36+
37+
#class CarModel(models.Model):
38+
# car_make = models.ForeignKey(CarMake, on_delete=models.CASCADE) #Many-to-One relationship
39+
# name = models.CharField(max_length=100)
40+
# CAR_TYPES = [
41+
# ('SEDAN', 'Sedan'),
42+
# ('SUV', 'SUV'),
43+
# ('WAGON', 'Wagon'),
4444
# Add more choices as required
45-
]
46-
type = models.CharField(max_length=10, choices=CAR_TYPES, default='SUV')
47-
year = models.IntegerField(default=2023,
48-
validators=[
49-
MaxValueValidator(2023),
50-
MinValueValidator(2015)
51-
]
52-
)
45+
# ]
46+
# type = models.CharField(max_length=10, choices=CAR_TYPES, default='SUV')
47+
# year = models.IntegerField(default=2023,
48+
# validators=[
49+
# MaxValueValidator(2023),
50+
# MinValueValidator(2015)
51+
# ]
52+
# )
5353
# Other fields as needed
5454

5555
def __str__(self):

0 commit comments

Comments
 (0)