Changes between Version 6 and Version 7 of ModelSyntaxChangeInstructions


Ignore:
Timestamp:
Aug 25, 2005, 4:49:07 PM (19 years ago)
Author:
Adrian Holovaty
Comment:

Added note about db_column.

Legend:

Unmodified
Added
Removed
Modified
  • ModelSyntaxChangeInstructions

    v6 v7  
    77 * Fields are now attributes of the model class, rather than members of a {{{fields}}} list.
    88 * Meta information (anything that's NOT a field, such as {{{ordering}}}, {{{admin}}}, {{{unique_together}}}, etc.) now goes in an inner class, called {{{META}}} (note the all caps). This class doesn't have a parent class.
     9 * To manually specify a field's database column name, use {{{db_column}}} as an argument to {{{*Field()}}}.
    910 * Each field is required to have an explicit name -- even {{{ForeignKey}}}s, {{{ManyToManyField}}}s and {{{OneToOneFields}}}. This solves the problem of "How do I refer to my field from within admin.fields?"
    1011 * {{{rel_name}}} is no longer used for {{{ForeignKey}}}s. If your model has more than one {{{ForeignKey}}} to the same foreign model, differentiate the fields using the field name, not {{{rel_name}}}. See [http://www.djangoproject.com/documentation/models/m2o_recursive2/ Relating a model to another model more than once] for an example.
Back to Top