Entries published on November 4, 2007
Working with models, part 2
Now that we’ve got a handle on how to generically load models without necessarily knowing in advance which models, it’s time to start looking at interesting things we can do with them once we’ve got them. There are lots of uses for code which can introspect any model and extract information from it, some of which you’ve probably already seen:
- The Django admin interface introspects model classes to determine how to display and edit them.
-
Shortcuts in both the old and new forms systems exist for generating forms automatically from a model (
AddManipulator
andChangeManipulator
in oldforms,form_for_model
andform_for_instance
in newforms). …