ajout des types de champ
This commit is contained in:
parent
373a1133de
commit
aa72819840
133
port/models.py
133
port/models.py
|
@ -1,74 +1,83 @@
|
|||
from django.db import models
|
||||
from django.db.models import Model, CharField, EmailField, \
|
||||
DateTimeField, DecimalField, ForeignKey
|
||||
|
||||
class Address(models.Model):
|
||||
address =
|
||||
zip_code =
|
||||
city =
|
||||
country =
|
||||
class Address(Model):
|
||||
address = CharFIELD(MAX_length=254)
|
||||
zip_code = CharField(max_length=10)
|
||||
city = CharField(max_length=200)
|
||||
country = CharField(max_length=200)
|
||||
|
||||
class Person(models.Model):
|
||||
name = models.CharField(max_length=200)
|
||||
surname = models.CharField(max_length=200)
|
||||
address =
|
||||
nationality =
|
||||
email =
|
||||
phone =
|
||||
|
||||
class Company(models.Model):
|
||||
name =
|
||||
address =
|
||||
siret =
|
||||
class Person(Model):
|
||||
name = CharField(max_length=50)
|
||||
surname = CharField(max_length=50)
|
||||
nationality = CharField(max_length=200)
|
||||
email = EmailField(max_length=200)
|
||||
phone = CharField(max_length=20)
|
||||
|
||||
# Foreign keys
|
||||
address = ForeignKey(Address)
|
||||
|
||||
class Company(Model):
|
||||
name = CharField(max_length=50)
|
||||
address = CharField(max_length=254)
|
||||
nationality = CharField(max_length=50)
|
||||
email = EmailField(max_length=200)
|
||||
phone = CharField(max_length=20)
|
||||
|
||||
class Insurance(Company):
|
||||
pass
|
||||
|
||||
class Boat(models.Model):
|
||||
name =
|
||||
registration_num =
|
||||
length =
|
||||
beam =
|
||||
water_draught =
|
||||
tonnage =
|
||||
water_tank =
|
||||
model =
|
||||
heating =
|
||||
class Boat(Model):
|
||||
name = CharField(max_length=50)
|
||||
registration_num = CharField(max_length=20)
|
||||
length = DecimalField()
|
||||
beam = DecimalField()
|
||||
water_draught = DecimalField()
|
||||
tonnage = DecimalField()
|
||||
water_tank = DecimalField()
|
||||
model = CharField(max_length=50)
|
||||
heating = CharField(max_length=50)
|
||||
|
||||
class Port(models.Model):
|
||||
name =
|
||||
address =
|
||||
# Foreign keys
|
||||
insurance = Insurance()
|
||||
|
||||
class Dock(models.Model):
|
||||
num =
|
||||
length =
|
||||
width =
|
||||
depth =
|
||||
class Port(Model):
|
||||
name = CharField(max_length=50)
|
||||
address = CharField(max_length=254)
|
||||
|
||||
class Plug(models.Model):
|
||||
num =
|
||||
amperage =
|
||||
voltage =
|
||||
class Dock(Model):
|
||||
num = CharField(max_length=4)
|
||||
length = DecimalField()
|
||||
width = DecimalField()
|
||||
depth = DecimalField()
|
||||
|
||||
class Tap(models.Model):
|
||||
num =
|
||||
class Plug(Model):
|
||||
num = CharField(max_length=4)
|
||||
amperage = DecimalField()
|
||||
voltage = DecimalField()
|
||||
|
||||
class Stay(models.Model):
|
||||
arrival = models.DateTimeField('date published')
|
||||
departure = models.DateTimeField('date published')
|
||||
coming_from =
|
||||
going_to =
|
||||
|
||||
class Payment(models.Model):
|
||||
num =
|
||||
date = models.DateTimeField('date published')
|
||||
pay_type =
|
||||
amount =
|
||||
|
||||
class Bill_line(models.Model):
|
||||
service =
|
||||
quantity =
|
||||
|
||||
class Service(models.Model):
|
||||
service_type =
|
||||
|
||||
|
||||
# Create your models here.
|
||||
class Tap(Model):
|
||||
num = CharField(max_length=4)
|
||||
|
||||
class Stay(Model):
|
||||
arrival = DateTimeField()
|
||||
departure = DateTimeField()
|
||||
coming_from = CharField(max_length=150)
|
||||
going_to = CharField(max_length=150)
|
||||
|
||||
class PaymentType(Model):
|
||||
name = CharField(max_length=20)
|
||||
|
||||
class Payment(Model):
|
||||
num = CharField(max_length=40)
|
||||
date = DateTimeField()
|
||||
pay_type = ForeignKey(PaymentType)
|
||||
amount = DecimalField()
|
||||
|
||||
class Service(Model):
|
||||
service_type = CharField(max_length=50)
|
||||
|
||||
class Bill_line(Model):
|
||||
service = Service()
|
||||
quantity = DecimalField()
|
||||
|
|
Loading…
Reference in New Issue