2011-09-09 21:22:28 +02: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 05:36:09 +01:00
|
|
|
|
2015-06-18 16:12:07 +02: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 21:22:28 +02:00
|
|
|
class Place(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2011-09-09 21:22:28 +02:00
|
|
|
class Restaurant(Place):
|
|
|
|
pass
|
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2011-09-09 21:22:28 +02:00
|
|
|
class Pizzeria(Restaurant):
|
|
|
|
pass
|
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2011-09-09 21:22:28 +02:00
|
|
|
class State(models.Model):
|
2012-04-29 03:22:05 +02:00
|
|
|
two_letter_code = models.CharField(max_length=2, primary_key=True)
|
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2012-04-29 03:22:05 +02:00
|
|
|
class TwoFields(models.Model):
|
|
|
|
f1 = models.IntegerField(unique=True)
|
|
|
|
f2 = models.IntegerField(unique=True)
|
2015-10-09 03:14:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
class NoFields(models.Model):
|
|
|
|
pass
|