You have learned many interesting features in this chapter. You are now able to create any type of web feed with ease. You also gained a lot of information on how to use the Django database API to query data models in various ways. Finally, you learned about pagination in Django and applied it to a view in the project.
Here is a quick summary of the features covered in this chapter:
To create a feed in Django, derive a class that represents the feed from the
Feed
base class, and define the properties of the feed (title, link, description) and a method calleditems
that returns the items of the feed in this class.To customize the rendering of item fields in the feed (such as title and description), create a folder called
feeds
in thetemplates
folder. Inside it, create templates with filenames that use the following format:feedname_fieldname.html
. The contents of these templates will be used to render item fields.Q
objects are very useful to construct complex queries. They encapsulate...