Changes between Version 19 and Version 20 of ModelInheritance
- Timestamp:
- Feb 27, 2006, 5:48:46 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ModelInheritance
v19 v20 120 120 || || python || result || 121 121 || A. || {{{Place.objects.count()}}} || 3 || 122 122 123 || B. || {{{Restaurant.objects.count()}}} || 2 || 123 124 || C. || {{{ItalianRestaurant.objects.count()}}} || 1 || … … 181 182 182 183 }}} 184 185 We can then add all of the parent fields to the new class like so: 186 187 {{{ 188 for parent in new_class._meta.parents: 189 for field in parent._meta.fields: 190 field.contribute_to_class(new_class, field.name) 191 }}}