Re: Multiple model inheritance

2013-01-06 Thread nkryptic
yes, yes, no and yes. Abstract models should inherit form models.Model. Abstract models should always have a Meta class with abstract=True. The order matters when it comes to shared functionality. Here's how I would code those models you had: class Taggable(models.Model): tag =

Re: Multiple model inheritance

2013-01-05 Thread Peter of the Norse
I’m not sure that’s possible. Even abstract Models do magic in the background. Specifically there's the _meta class attribute that gets inherited. If you were to try it, only one of the _metas would be included. On Dec 31, 2012, at 6:12 AM, Mattias Linnap wrote: > Hi all, > > I would like to

Multiple model inheritance

2012-12-31 Thread Mattias Linnap
Hi all, I would like to define multiple abstract base models with small set of fields each. The "real" models inherit from multiple mixins to add the fields. For example: class Taggable(?): tag = models.CharField() class Visible(?): visible = models.BooleanField() class SomeFullModel(?,