Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

4. Getting Fancier: Django Unit Test Ext... > Customizing the admin add and change...

Customizing the admin add and change survey pages

We've already seen how the Django admin application provides a convenient way to examine and manipulate data in our database. In the previous chapter, we set up the admin with some simple customizations to allow editing Questions inline with Surveys and Answers inline with Questions. Besides those inline customizations, however, we made no changes to the admin defaults.

One additional change that would be good to make to the admin is to ensure that Survey opens and closes dates are valid. Clearly for this application, it makes no sense to have an opens date that is later than closes, but there is no way for the admin to know that. In this section, we will customize the admin to enforce our application requirement on the relationship between opens and closes. We will also develop a test for this customization.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial