O'Reilly logo

Python Web Development with Django® by Wesley Chun, Jeff Forcier, Paul Bissex

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Defining and Using Models

As explained in Chapter 3, “Starting Out,” the data model of a Web application is usually its foundation, and at any rate is an excellent place to begin exploring the details of Django development. Although this chapter has two main sections—defining models, and then using them—the two halves are more intertwined than separate. We need to consider how we plan to use our models, while we’re defining them, to generate the most effective arrangement of classes and relationships. And, of course, you can’t make the best use of a model without understanding the how and the why of its definition.

Defining Models

Django’s database model layer makes heavy use of an ORM (Object-Relational Mapper), and it’s a good idea ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required