Changes between Version 34 and Version 35 of ModelInheritance
- Timestamp:
- Jun 2, 2006, 1:45:40 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ModelInheritance
v34 v35 1 = magic-removal:Model Inheritance =1 = Model Inheritance = 2 2 3 3 This is a proposal for how subclassing should work in Django. There a lot of details to get right, so this proposal should be very specific and detailed. Most of the ideas here come from the thread linked below: … … 261 261 262 262 {{{ 263 #!python 263 264 class Place(models.Model): 264 265 name = models.CharField(maxlength=50) … … 271 272 272 273 {{{ 274 #!python 273 275 class Place(models.Model): 274 276 _meta = ... … … 282 284 283 285 {{{ 286 #!python 284 287 # Build complete list of parents 285 288 for base in bases: … … 292 295 293 296 {{{ 297 #!python 294 298 # Add Fields inherited from parents 295 299 for parent in new_class._meta.parents: