Source

djangorators / examples / djangorators_testproject / models.py

Full commit
1
2
3
4
5
6
7
8
9
from django.db import models
from django.contrib.auth.models import User

class Animal(models.Model):
    name = models.CharField(max_length=50)
    owner = models.ForeignKey(User)
    
    def __unicode__(self):
        return u'%s owned by %s' % (self.name, self.owner)