Skip to content

Commit 7a963f8

Browse files
committed
Module 5 commit 8 python issues linting
1 parent ff0f38d commit 7a963f8

File tree

6 files changed

+244
-228
lines changed

6 files changed

+244
-228
lines changed

server/djangoapp/models.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class CarMake(models.Model):
1616
Attributes:
1717
name (str): The name of the car manufacturer.
1818
description (str): A description of the car manufacturer.
19-
country_of_origin (str, optional): The country where the car manufacturer is based.
20-
established_date (date, optional): The date when the car manufacturer was established.
19+
country_of_origin (str, optional):
20+
established_date (date, optional):
2121
"""
2222

2323
name = models.CharField(max_length=100)
@@ -31,26 +31,26 @@ def __str__(self):
3131

3232
class CarModel(models.Model):
3333
"""
34-
Represents a car model associated with a specific car make (e.g., Camry, Mustang, etc.).
34+
Represents a car model with a specific car make
3535
3636
The CarModel model stores details about a specific model of a car,
3737
including its make, type, year, engine type, fuel type, color, price,
3838
mileage, horsepower, and transmission.
3939
4040
Attributes:
41-
car_make (ForeignKey): A reference to the CarMake model representing the car's manufacturer.
41+
car_make (ForeignKey):
4242
name (str): The name of the car model (e.g., Camry, A-Class).
4343
type (str): The type of the car (e.g., Sedan, SUV, Wagon).
4444
year (int): The year the car model was manufactured.
4545
engine_type (str, optional): The type of engine in the car.
46-
fuel_type (str): The fuel type used by the car (e.g., Petrol, Diesel, Electric, Hybrid).
46+
fuel_type (str):
4747
color (str, optional): The color of the car.
4848
price (decimal, optional): The price of the car.
4949
mileage (float, optional): The mileage of the car.
5050
horsepower (int, optional): The horsepower of the car's engine.
51-
transmission (str): The type of transmission in the car (e.g., Automatic, Manual).
51+
transmission (str):
5252
"""
53-
car_make = models.ForeignKey(CarMake, on_delete = models.CASCADE)
53+
car_make = models.ForeignKey(CarMake, on_delete=models.CASCADE)
5454
name = models.CharField(max_length=100)
5555
CAR_TYPES = [
5656
('SEDAN', 'Sedan'),
@@ -60,10 +60,10 @@ class CarModel(models.Model):
6060
]
6161
type = models.CharField(max_length=10, choices=CAR_TYPES, default='SUV')
6262
year = models.IntegerField(default=2023,
63-
validators=[
64-
MaxValueValidator(2023),
65-
MinValueValidator(2015)
66-
])
63+
validators = [
64+
MaxValueValidator(2023),
65+
MinValueValidator(2015)
66+
])
6767
engine_type = models.CharField(max_length=50, blank=True, null=True)
6868
fuel_type = models.CharField(
6969
max_length=20,
@@ -76,7 +76,10 @@ class CarModel(models.Model):
7676
default='PETROL'
7777
)
7878
color = models.CharField(max_length=30, blank=True, null=True)
79-
price = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
79+
price = models.DecimalField(
80+
max_digits=10, decimal_places=2,
81+
blank=True, null=True
82+
)
8083
mileage = models.FloatField(blank=True, null=True)
8184
horsepower = models.IntegerField(blank=True, null=True)
8285
transmission = models.CharField(

0 commit comments

Comments
 (0)