from django.db import models from django.db.models import Model, CharField, EmailField, \ DateTimeField, DecimalField, ForeignKey <<<<<<< HEAD class Address(models.Model): address = models.CharField(max_length=200) zip_code = models.CharField(max_length=200) city = models.CharField(max_length=200) country = models.CharField(max_length=200) class Person(models.Model): name = models.CharField(max_length=200) surname = models.CharField(max_length=200) address = Address() nationality = models.CharField(max_length=200) email = models.EmailField(max_length=254) phone = class Company(models.Model): name = models.CharField(max_length=200) address = Address() ======= 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(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) >>>>>>> modif_local class Insurance(Company): pass <<<<<<< HEAD class Boat(models.Model): name = models.CharField(max_length=200) registration_num = length = beam = water_draught = tonnage = water_tank = model = models.CharField(max_length=200) heating = models.CharField(max_length=200) passenger_capacity = picture = models.ImageField(upload_to=None, height_field=None, width_field=None, max_length=100) class Port(models.Model): name = models.CharField(max_length=200) 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 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) # Foreign keys insurance = Insurance() class Port(Model): name = CharField(max_length=50) address = CharField(max_length=254) class Dock(Model): num = CharField(max_length=4) length = DecimalField() width = DecimalField() depth = DecimalField() class Plug(Model): num = CharField(max_length=4) amperage = DecimalField() voltage = DecimalField() 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() >>>>>>> modif_local