22 lines
767 B
Python
22 lines
767 B
Python
from django.db import models
|
|
|
|
from .places import Nationality, ZipPlaces
|
|
|
|
|
|
class CrewMember(models.Model):
|
|
pin = models.IntegerField(primary_key=True)
|
|
|
|
first_name = models.CharField(max_length=128)
|
|
middle_name = models.CharField(max_length=128, null=True, blank=True)
|
|
last_name = models.CharField(max_length=128)
|
|
calling_name = models.CharField(max_length=128)
|
|
|
|
nationality = models.ForeignKey(Nationality, models.PROTECT)
|
|
place_of_birth = models.CharField(max_length=128)
|
|
first_address = models.ForeignKey(Address, models.PROTECT)
|
|
second_address = models.ForeignKey(Address, models.PROTECT, null=True)
|
|
|
|
class Address(models.Model):
|
|
address = models.TextField()
|
|
zipplace = models.ForeignKey(ZipPlaces, models.PROTECT)
|
|
|