PageRenderTime 48ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/modeltests/pagination/models.py

https://code.google.com/p/mango-py/
Python | 17 lines | 6 code | 4 blank | 7 comment | 0 complexity | e7bb431541ea6e6bebc8616ee120aa3e MD5 | raw file
Possible License(s): BSD-3-Clause
  1. """
  2. 30. Object pagination
  3. Django provides a framework for paginating a list of objects in a few lines
  4. of code. This is often useful for dividing search results or long lists of
  5. objects into easily readable pages.
  6. """
  7. from django.db import models
  8. class Article(models.Model):
  9. headline = models.CharField(max_length=100, default='Default headline')
  10. pub_date = models.DateTimeField()
  11. def __unicode__(self):
  12. return self.headline