Systemy-rozmyte-sql/backend/cars/models.py

15 lines
508 B
Python
Raw Normal View History

2022-01-03 00:09:16 +01:00
from django.db import models
2022-01-23 13:45:56 +01:00
2022-01-03 00:09:16 +01:00
class Car(models.Model):
mark = models.CharField(max_length=150)
model = models.CharField(max_length=150)
mileage = models.PositiveIntegerField()
production_year = models.PositiveSmallIntegerField()
2022-01-15 17:40:16 +01:00
engine_capacity = models.DecimalField(decimal_places=2, max_digits=16)
combustion = models.DecimalField(decimal_places=2, max_digits=16)
price = models.DecimalField(decimal_places=2, max_digits=16)
2022-01-03 00:09:16 +01:00
def __str__(self) -> str:
2022-01-23 13:45:56 +01:00
return "Car"