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 =
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
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(?,
3 matches
Mail list logo