Changes between Version 1 and Version 2 of DynamicModels
- Timestamp:
- May 9, 2007, 2:47:12 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DynamicModels
v1 v2 91 91 * {{{name}}} - The name of the model to be created 92 92 * {{{fields}}} - A dictionary of fields the model will have (managers and methods would go in this dictionary as well) 93 * {{{app_label}}} - A custom application label for the model (this does not have to exist in your project, but see the [ [#Admininterface Admin drawback]] below)93 * {{{app_label}}} - A custom application label for the model (this does not have to exist in your project, but see the [#Admininterface Admin drawback] below) 94 94 * {{{module}}} - An arbitrary module name to use as the model's source (prior to [5163], this had to be a real module path that had in fact been loaded) 95 95 * {{{options}}} - A dictionary of options, as if they were provided to the inner {{{Meta}}} class 96 * {{{admin}}} - A dictionary of admin options, as if they were provided to the inner {{{Admin}}} class (again, see [ [#Admininterface Admin drawback]] below)96 * {{{admin}}} - A dictionary of admin options, as if they were provided to the inner {{{Admin}}} class (again, see [#Admininterface Admin drawback] below) 97 97 98 98 Models can be created using this class with any number of features, as shown by the examples below. … … 197 197 }}} 198 198 199 This doesn't take {{{Meta}}} or {{{Admin}}} options into account, nor does it allow for the creation of any model methods, but it's a decent example of how it could be done. Now a model can be created based on a database-backed description, as simply as this (but see the [ [#Syncdb syncdb]] section for more details):199 This doesn't take {{{Meta}}} or {{{Admin}}} options into account, nor does it allow for the creation of any model methods, but it's a decent example of how it could be done. Now a model can be created based on a database-backed description, as simply as this (but see the [#Syncdb syncdb] section for more details): 200 200 201 201 {{{