equal
deleted
inserted
replaced
|
1 from django.db import models |
|
2 |
|
3 class Reporter(models.Model): |
|
4 first_name = models.CharField(max_length=30) |
|
5 last_name = models.CharField(max_length=30) |
|
6 email = models.EmailField() |
|
7 facebook_user_id = models.BigIntegerField() |
|
8 |
|
9 def __unicode__(self): |
|
10 return u"%s %s" % (self.first_name, self.last_name) |
|
11 |
|
12 class Article(models.Model): |
|
13 headline = models.CharField(max_length=100) |
|
14 pub_date = models.DateField() |
|
15 reporter = models.ForeignKey(Reporter) |
|
16 |
|
17 def __unicode__(self): |
|
18 return self.headline |
|
19 |
|
20 class Meta: |
|
21 ordering = ('headline',) |