Skip to content

Instantly share code, notes, and snippets.

@CapnKernel
Created January 7, 2016 04:28
Show Gist options
  • Select an option

  • Save CapnKernel/2f0ddd9cbb510811687b to your computer and use it in GitHub Desktop.

Select an option

Save CapnKernel/2f0ddd9cbb510811687b to your computer and use it in GitHub Desktop.
A model for postal addresses.
# Address model
class AddressBook(models.Model):
id = models.AutoField(primary_key=True, db_column="address_book_id")
customer = models.ForeignKey(Customer, db_column='customers_id')
gender = models.CharField(max_length=3, db_column="entry_gender")
company = models.CharField(max_length=192, blank=True, db_column="entry_company")
firstname = models.CharField(max_length=96, db_column="entry_firstname")
lastname = models.CharField(max_length=96, db_column="entry_lastname")
street = models.CharField(max_length=192, db_column="entry_street_address")
suburb = models.CharField(max_length=96, blank=True, db_column="entry_suburb")
postcode = models.CharField(max_length=30, db_column="entry_postcode")
city = models.CharField(max_length=96, db_column="entry_city")
hidden_state = models.CharField(max_length=96, blank=True, db_column="entry_state")
country = models.ForeignKey(Country, db_column="entry_country_id")
zone = models.ForeignKey(Zone, db_column="entry_zone_id")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment