PageRenderTime 42ms CodeModel.GetById 39ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/regressiontests/model_formsets_regress/models.py

https://code.google.com/p/mango-py/
Python | 29 lines | 21 code | 8 blank | 0 comment | 0 complexity | 5273b5a5f9137f7ed3796fd7ea7c1469 MD5 | raw file
 1from django.db import models
 2
 3class User(models.Model):
 4    username = models.CharField(max_length=12, unique=True)
 5    serial = models.IntegerField()
 6
 7class UserSite(models.Model):
 8    user = models.ForeignKey(User, to_field="username")
 9    data = models.IntegerField()
10
11class Place(models.Model):
12    name = models.CharField(max_length=50)
13
14class Restaurant(Place):
15    pass
16
17class Manager(models.Model):
18    retaurant = models.ForeignKey(Restaurant)
19    name = models.CharField(max_length=50)
20
21class Network(models.Model):
22    name = models.CharField(max_length=15)
23
24class Host(models.Model):
25    network = models.ForeignKey(Network)
26    hostname = models.CharField(max_length=25)
27
28    def __unicode__(self):
29        return self.hostname