2011-09-09 19:22:28 +00:00
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
|
|
|
class Country(models.Model):
|
|
|
|
name = models.CharField(max_length=255)
|
|
|
|
iso_two_letter = models.CharField(max_length=2)
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2015-06-18 14:12:07 +00:00
|
|
|
class ProxyCountry(Country):
|
|
|
|
class Meta:
|
|
|
|
proxy = True
|
|
|
|
|
|
|
|
|
|
|
|
class ProxyProxyCountry(ProxyCountry):
|
|
|
|
class Meta:
|
|
|
|
proxy = True
|
|
|
|
|
|
|
|
|
|
|
|
class ProxyMultiCountry(ProxyCountry):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class ProxyMultiProxyCountry(ProxyMultiCountry):
|
|
|
|
class Meta:
|
|
|
|
proxy = True
|
|
|
|
|
|
|
|
|
2011-09-09 19:22:28 +00:00
|
|
|
class Place(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2011-09-09 19:22:28 +00:00
|
|
|
class Restaurant(Place):
|
|
|
|
pass
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2011-09-09 19:22:28 +00:00
|
|
|
class Pizzeria(Restaurant):
|
|
|
|
pass
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2011-09-09 19:22:28 +00:00
|
|
|
class State(models.Model):
|
2012-04-29 01:22:05 +00:00
|
|
|
two_letter_code = models.CharField(max_length=2, primary_key=True)
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2012-04-29 01:22:05 +00:00
|
|
|
class TwoFields(models.Model):
|
|
|
|
f1 = models.IntegerField(unique=True)
|
|
|
|
f2 = models.IntegerField(unique=True)
|
2015-10-09 01:14:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
class NoFields(models.Model):
|
|
|
|
pass
|