django-mptt/django-mptt — Issue #148: mptt options are not inherited from the parent class 
Author: amenasse
Created: 2011-10-24 06:09:20+00:00
State: open

currently mptt options are not inherited from their parent class

Current behavour:

class AbstractThing(MPTTModel):

name = models.CharField(max_length=50)
parent = models.ForeignKey('self', null=True, blank=True, related_name='children')

class MPTTMeta:
order_insertion_by = ['name',]

class Meta:
abstract = True

class ConcreteThing(AbstractThing):
pass

order_insertion_by property currently uses the default value even though we overrode it in AbstractThing's MPTTOption class:

>>> Thing._mptt_meta.order_insertion_by
[]

The use case for us is to provide a sane default for order_insertion_by in an abstract class so users of the concrete class don't have to remember to explicitly set this.

We currently work around it by using a custom metaclass.