This commit is contained in:
Eden Kirin
2024-04-10 22:04:10 +02:00
parent f06b72343b
commit 929e16e2ec
9 changed files with 500 additions and 1 deletions

View File

@ -0,0 +1,3 @@
from .area import Area
from .county import County
from .post_office import PostOffice

View File

@ -0,0 +1,11 @@
from django.db import models
class Area(models.Model):
name = models.CharField(max_length=100)
post_office = models.ForeignKey("PostOffice", on_delete=models.CASCADE)
county = models.ForeignKey("County", on_delete=models.CASCADE)
class Meta:
db_table = "areas"
ordering = ["name"]

View File

@ -0,0 +1,9 @@
from django.db import models
class County(models.Model):
name = models.CharField(max_length=100)
class Meta:
db_table = "counties"
ordering = ["name"]

View File

@ -0,0 +1,10 @@
from django.db import models
class PostOffice(models.Model):
zip = models.PositiveIntegerField()
name = models.CharField(max_length=100)
class Meta:
db_table = "post_offices"
ordering = ["zip"]