Hi Johannes,

Yes inheriting the managers is in fact how I currently deal with the
situation however I feel as though this violates the DRY principle as
the relationship is already expressed via the model inheritance. I
guess "explicit is better than implicit" chimes in here to some
degree.


On Mar 4, 8:02 pm, Johannes Dollinger
<johannes.dollin...@einfallsreich.net> wrote:
> Hi Steve,
>
> Multiple inheritance with abstract models works, and mostly did since  
> the feature was added afaict. I use it regulary.
> Just stay away from diamond inheritance and multi-multi-table  
> inheritance.
>
> Regarding your managers: couldn't you just use inheritance explicitly?
>
>    class ManagerC(ManagerA, ManagerB): pass
>
>    class ModelC(ModelA, ModelB):
>          objects = ManagerC()
>
> __
> Johannes
>
> Am 03.03.2010 um 23:08 schrieb Stephen McDonald:
>
>
>
> > Hi Russel,
>
> > Thanks for your feedback. That's a really interesting position to
> > learn about with regard to multiple inheritance as I use it all the
> > time across basic abstract models without any issues.
>
> > The approach I was thinking of is very simplistic and possibly naive.
> > It appears as though I just need to modify
> > django.db.models.ModelBase.copy_managers to dynamically create the new
> > managers and assign those to the model class where overlapping
> > attribute names (eg objects) occur.
>
> > If anyone else has any further insight to whether this would work I'd
> > really appreciate it.
>
> > Steve

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to