b695dd8054
Moved helpers and views to their respective new apps
23 lines
724 B
Python
23 lines
724 B
Python
from django.db import models
|
|
|
|
class Suburb(models.Model):
|
|
STATE = [
|
|
("VIC", "Victoria"),
|
|
("NSW", "New South Wales"),
|
|
("SA", "South Australia"),
|
|
("ACT", "Australia Capital Territory"),
|
|
("QLD", "Queensland"),
|
|
("NT", "Northern Territory"),
|
|
("WA", "Western Australia"),
|
|
("TAS", "Tasmania"),
|
|
]
|
|
name = models.CharField(max_length=30, unique=True)
|
|
state = models.CharField(max_length=3, choices=STATE)
|
|
postcode = models.PositiveSmallIntegerField()
|
|
distance = models.PositiveSmallIntegerField(blank=True, null=True)
|
|
|
|
class Meta:
|
|
ordering = ["name"]
|
|
|
|
def __str__(self):
|
|
return f"{self.name}, {self.state} {self.postcode}" |