merge reussi
This commit is contained in:
commit
bc6eda7a15
145
port/models.py
145
port/models.py
|
@ -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()
|
|
||||||
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()
|
address = Address()
|
||||||
|
nationality = CharField(max_length=200)
|
||||||
|
email = EmailField(max_length=254)
|
||||||
|
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 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):
|
class Port(Model):
|
||||||
num =
|
name = CharField(max_length=50)
|
||||||
amperage =
|
|
||||||
voltage =
|
|
||||||
|
|
||||||
class Tap(models.Model):
|
# Foreign keys
|
||||||
num =
|
address = ForeignKey(Address)
|
||||||
|
|
||||||
class Stay(models.Model):
|
class Dock(Model):
|
||||||
arrival = models.DateTimeField('date published')
|
num = CharField(max_length=10)
|
||||||
departure = models.DateTimeField('date published')
|
length = DecimalField()
|
||||||
coming_from = models.CharField(max_length=200)
|
width = DecimalField()
|
||||||
going_to = models.CharField(max_length=200)
|
depth = DecimalField()
|
||||||
num_passenger =
|
|
||||||
num_guest =
|
class Plug(Model):
|
||||||
|
num = CharField(max_length=10)
|
||||||
class Payment(models.Model):
|
amperage = DecimalField()
|
||||||
num =
|
voltage = DecimalField()
|
||||||
date = models.DateTimeField('date published')
|
|
||||||
pay_type = models.CharField(max_length=200)
|
|
||||||
amount =
|
class Tap(Model):
|
||||||
|
num = CharField(max_length=10)
|
||||||
class Bill_line(models.Model):
|
|
||||||
service = models.CharField(max_length=200)
|
class Stay(Model):
|
||||||
quantity =
|
arrival = DateTimeField()
|
||||||
|
departure = DateTimeField('date published')
|
||||||
class Service(models.Model):
|
coming_from = CharField(max_length=200)
|
||||||
service_type = models.CharField(max_length=200)
|
going_to = CharField(max_length=200)
|
||||||
|
|
||||||
|
class PaymentType(Model):
|
||||||
# Create your models here.
|
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()
|
||||||
|
|
Loading…
Reference in New Issue