merge reussi

This commit is contained in:
maxime 2019-05-31 11:40:06 +02:00
commit bc6eda7a15
1 changed files with 81 additions and 64 deletions

View File

@ -1,77 +1,94 @@
from django.db import models from django.db import models
from django.db.models import Model, CharField, EmailField, \
DateTimeField, DecimalField, ForeignKey
class Address(models.Model): class Address(Model):
address = models.CharField(max_length=200) address = CharField(max_length=200)
zip_code = models.CharField(max_length=200) zip_code = CharField(max_length=10)
city = models.CharField(max_length=200) city = CharField(max_length=200)
country = models.CharField(max_length=200) country = CharField(max_length=200)
class Person(models.Model): class Person(Model):
name = models.CharField(max_length=200) name = CharField(max_length=50)
surname = models.CharField(max_length=200) surname = CharField(max_length=50)
address = Address() address = Address()
nationality = models.CharField(max_length=200) nationality = CharField(max_length=200)
email = models.EmailField(max_length=254) email = EmailField(max_length=254)
phone = 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)
# Foreign keys
address = ForeignKey(Address)
class Company(models.Model):
name = models.CharField(max_length=200)
address = Address()
class Insurance(Company): class Insurance(Company):
pass pass
class Boat(models.Model): class Boat(Model):
name = models.CharField(max_length=200) name = CharField(max_length=50)
registration_num = registration_num = CharField(max_length=20)
length = length = DecimalField()
beam = beam = DecimalField()
water_draught = water_draught = DecimalField()
tonnage = tonnage = DecimalField()
water_tank = water_tank = DecimalField()
model = models.CharField(max_length=200) model = CharField(max_length=50)
heating = models.CharField(max_length=200) heating = CharField(max_length=50)
passenger_capacity = passenger_capacity = IntegerField()
picture = models.ImageField(upload_to=None, height_field=None, width_field=None, max_length=100) picture = ImageField(upload_to=None, height_field=None, width_field=None, max_length=100)
class Port(models.Model): # Foreign keys
name = models.CharField(max_length=200) insurance = Insurance()
address = Address()
class Dock(models.Model):
num =
length =
width =
depth =
class Plug(models.Model):
num =
amperage =
voltage =
class Tap(models.Model):
num =
class Stay(models.Model):
arrival = models.DateTimeField('date published')
departure = models.DateTimeField('date published')
coming_from = models.CharField(max_length=200)
going_to = models.CharField(max_length=200)
num_passenger =
num_guest =
class Payment(models.Model):
num =
date = models.DateTimeField('date published')
pay_type = models.CharField(max_length=200)
amount =
class Bill_line(models.Model):
service = models.CharField(max_length=200)
quantity =
class Service(models.Model):
service_type = models.CharField(max_length=200)
# Create your models here. class Port(Model):
name = CharField(max_length=50)
# Foreign keys
address = ForeignKey(Address)
class Dock(Model):
num = CharField(max_length=10)
length = DecimalField()
width = DecimalField()
depth = DecimalField()
class Plug(Model):
num = CharField(max_length=10)
amperage = DecimalField()
voltage = DecimalField()
class Tap(Model):
num = CharField(max_length=10)
class Stay(Model):
arrival = DateTimeField()
departure = DateTimeField('date published')
coming_from = CharField(max_length=200)
going_to = CharField(max_length=200)
class PaymentType(Model):
name = CharField(max_length=20)
class Payment(Model):
num = CharField(max_length=40)
date = DateTimeField()
amount = DecimalField()
pay_type = ForeignKey(PaymentType)
class Service(Model):
service_type = CharField(max_length=50)
class Bill_line(Model):
service = ForeignKey(Service)
quantity = DecimalField()