changeset 69 | c6bca38c1cbf |
68:5ff1fc726848 | 69:c6bca38c1cbf |
---|---|
1 """ |
|
2 30. Object pagination |
|
3 |
|
4 Django provides a framework for paginating a list of objects in a few lines |
|
5 of code. This is often useful for dividing search results or long lists of |
|
6 objects into easily readable pages. |
|
7 """ |
|
8 |
|
9 from django.db import models |
|
10 |
|
11 |
|
12 class Article(models.Model): |
|
13 headline = models.CharField(max_length=100, default='Default headline') |
|
14 pub_date = models.DateTimeField() |
|
15 |
|
16 def __unicode__(self): |
|
17 return self.headline |