Chapter 10. Advanced Models
In Chapter 5 we presented an introduction to Django's database layer—how to define models and how to use the database API to create, retrieve, update, and delete records. In this chapter, we'll introduce you to some more advanced features of this part of Django.
Recall our book models from Chapter 5:
from django.db import models class Publisher(models.Model): name = models.CharField(max_length=30) address = models.CharField(max_length=50) city = models.CharField(max_length=60) state_province = models.CharField(max_length=30) country = models.CharField(max_length=50) website = models.URLField() def __unicode__(self): return self.name class Author(models.Model): first_name = models.CharField(max_length=30) ...