Re: Despite what django doc says, multiple inheritance with a common ancestor causes an error(models.E005). I found a tricky solution, but are there any better solutions?

2017-06-15 Thread Hyunsoo Kim
Currently no model is abstract. I can guarantee this because each model is referenced by one or more foreign keys. I don't think this is my special case problem. The same problem happens when you use the common ancestor model in the django document. -- You received this message because you are

Re: Despite what django doc says, multiple inheritance with a common ancestor causes an error(models.E005). I found a tricky solution, but are there any better solutions?

2017-06-14 Thread Melvyn Sopacua
On Tuesday 13 June 2017 09:54:03 Hyunsoo Kim wrote: > This doc > <https://docs.djangoproject.com/en/1.11/topics/db/models/#multiple-inh > eritance> says multiple inheritance with a common ancestor can do the > job. However, I've experienced an error while making migrations.

Despite what django doc says, multiple inheritance with a common ancestor causes an error(models.E005). I found a tricky solution, but are there any better solutions?

2017-06-13 Thread Hyunsoo Kim
This doc <https://docs.djangoproject.com/en/1.11/topics/db/models/#multiple-inheritance> says multiple inheritance with a common ancestor can do the job. However, I've experienced an error while making migrations. Here's the error message. > models.E005: The field '**_ptr' from par

Django app that adds multiple inheritance for Django auth groups?

2016-04-01 Thread Stodge
Is anyone aware of a Django app that adds multiple inheritance to Django auth groups? I know about django-hierarchical-auth but I want the ability to specify multiple parents for a group to make it easier to manage and group permissions. Thanks -- You received this message because you

Re: Django: "Fake" multiple inheritance

2015-08-17 Thread James Schneider
Just making sure. Good luck! -James On Aug 17, 2015 1:25 PM, "Michael Herrmann" wrote: > Yes, of course you're right James, sorry. My classes are actually named > differently and I was just trying to get the idea across. > M > > On 17 August 2015 at 22:23, James Schneider

Re: Django: "Fake" multiple inheritance

2015-08-17 Thread Michael Herrmann
Yes, of course you're right James, sorry. My classes are actually named differently and I was just trying to get the idea across. M On 17 August 2015 at 22:23, James Schneider wrote: > > > Hi gst, >> >> Instead of >> >> class Hotel(Place): >> ... >> >> I

Re: Django: "Fake" multiple inheritance

2015-08-17 Thread James Schneider
Hi gst, > > Instead of > > class Hotel(Place): > ... > > I ended up with > > class Hotel(object): > place = models.OneToOneField(Place, primary_key=True) > > I used a OneToOneField instead of ForeignKey because there can only be one > hotel in a Place. > > > Just to verify,

Re: Django: "Fake" multiple inheritance

2015-08-17 Thread Michael Herrmann
Hi gst, Instead of class Hotel(Place): ... I ended up with class Hotel(object): place = models.OneToOneField(Place, primary_key=True) I used a OneToOneField instead of ForeignKey because there can only be one hotel in a Place. M On 16 August 2015 at 16:22, gst

Re: Django: "Fake" multiple inheritance

2015-08-16 Thread gst
Will you care share it? I found the question interresting.. Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.

Re: Django: "Fake" multiple inheritance

2015-08-16 Thread Michael Herrmann
Thank you Daniel, I found another way. Best, Michael On 14 August 2015 at 23:17, Daniel H wrote: > Hi Michael. > > First of all, setting the pk to the pk of a different model will do > nothing. > > You can do this however, using Foreign Keys >

Re: Django: "Fake" multiple inheritance

2015-08-14 Thread Daniel H
Hi Michael. First of all, setting the pk to the pk of a different model will do nothing. You can do this however, using Foreign Keys restaurant = models.ForeignKey('Restautant') Then declare a new hotel

Django: "Fake" multiple inheritance

2015-08-14 Thread michael
Hi all, suppose I have the following model structure from django.db import models class Place(models.Model): name = models.CharField(max_length=50) class Restaurant(Place): ... class Hotel(Place): ... I already have a Restaurant in my

Same PTR behavior in multiple inheritance

2013-11-23 Thread Samuel Chávez
Hi guys, I have some issue with model multi inheritance in Django's ORM. I'm trying to create a ChildModel(ParentModelA, ParentModelB). When I create a ChildModel register, Django's ORM creates backstage both ParentModelA and ParentModelB registers. The odd thing is that both parent registers

Re: Is multiple inheritance with abstract model classes ok?

2011-06-22 Thread Kevin Renskers
Perfectly fine! -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/6Vp_0w_sz_cJ. To post to this group, send email to django-users@googlegroups.com. To

Is multiple inheritance with abstract model classes ok?

2011-06-20 Thread br
If I have three different abstract model base classes . . . I'd like to use them in multiple inheritance, sort of like Mixins. Any problems with this? E.g., class TaggableBase(models.Model): . . . class Meta: abstract = True class TimeStampedBase(models.Model): . . . class

Re: Multiple inheritance from models.Model and admin.ModelAdmin

2011-05-31 Thread Lee
Discovered that save_model() is still available even if I don't inherit admin.ModelAdmin, which avoids the metaclass conflict. On May 31, 10:36 am, Lee wrote: > I'm trying to create a class that inherits from both models.Model and > admin.ModelAdmin, so that I can use

Multiple inheritance from models.Model and admin.ModelAdmin

2011-05-31 Thread Lee
I'm trying to create a class that inherits from both models.Model and admin.ModelAdmin, so that I can use models.ManyToManyField and save_model() from admin.ModelAdmin. Unfortunately this combination gives "metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the

Abstract base classes, multiple inheritance and field removal

2011-05-26 Thread Justin
Hello All, I have a situation where I would like to combine two fields from two abstract child classes into a parent class. class A(model): field = MyField() class Meta: abstract = True class B(model): field = MyField() class Meta: abstract = True class C(A,

Re: Multiple inheritance model

2010-11-22 Thread Marc Aymerich
On Sun, Nov 21, 2010 at 7:51 PM, Joseph (Driftwood Cove Designs) < powderfl...@gmail.com> wrote: > this is django.db.models.base.Model.save_base() > > a comment in the code for ModelA indicates the call to save_base() is > required for Mptt. > > Joseph, I think the problem here is the ModelA

Re: Multiple inheritance model

2010-11-21 Thread Joseph (Driftwood Cove Designs)
this is django.db.models.base.Model.save_base() a comment in the code for ModelA indicates the call to save_base() is required for Mptt. On Nov 21, 5:43 am, Marc Aymerich wrote: > On Sun, Nov 21, 2010 at 5:31 AM, Joseph (Driftwood Cove Designs) < > > powderfl...@gmail.com>

Re: Multiple inheritance model

2010-11-21 Thread Marc Aymerich
On Sun, Nov 21, 2010 at 5:31 AM, Joseph (Driftwood Cove Designs) < powderfl...@gmail.com> wrote: > Below is the basic layout - I posted a simplified version of the two > model classes here: http://pastebin.com/Xc3KLrQx > > ModelA.save(): > if (some condition): > super().save_base() > Hi

Re: Multiple inheritance model

2010-11-20 Thread Joseph (Driftwood Cove Designs)
two existing apps, both of which provide a > > django Model - call them ModelA and ModelB - my app's model needs to > > inherit from both of these. > > I know django models support multiple inheritance, but both ModelA and > > ModelB define a Meta class, override the save() m

Re: Multiple inheritance model

2010-11-20 Thread Marc Aymerich
ngo models support multiple inheritance, but both ModelA and > ModelB define a Meta class, override the save() method, etc., so that > won't work. > > What will work very nicely is for ModelB to simply inherit from > ModelA, but since both are 3rd party apps, I don't want to hack thei

Multiple inheritance model

2010-11-19 Thread Joseph (Driftwood Cove Designs)
I'm trying to integrate two existing apps, both of which provide a django Model - call them ModelA and ModelB - my app's model needs to inherit from both of these. I know django models support multiple inheritance, but both ModelA and ModelB define a Meta class, override the save() method, etc

Form multiple inheritance

2010-05-11 Thread Daniel Hilton
class Meta: model = TaskAssignment fields = [ "days", "hours" ] class TaskUberForm(TaskBaseForm): """ Using the magic of multiple inheritance we can combine our two forms to create a new form that mak

Re: blocks in multiple inheritance

2008-03-02 Thread AJ
Turns out I figured out the problem. In the profile/profile.html file there was an {% ifequal %} block, and the {% block profile_content %} was inside that. This was causing the if to fail for the profile/ edit_profile.html template, thus no content. On Mar 2, 6:12 pm, AJ <[EMAIL PROTECTED]>

blocks in multiple inheritance

2008-03-02 Thread AJ
I'm having a trouble using some multiple inhertiance. The page seems to inherit properly but I can only define blocks for the "grand parent" and not the parent. Example: site/base.html -- {% block title %}{% endblock %} {% block content %} {% endblock %} stuff {% block

Re: multiple inheritance?

2006-01-31 Thread Eric Walstad
Hi Jason, On Tuesday 31 January 2006 09:36, [EMAIL PROTECTED] wrote: > hi, > > I want to do something like this: [...] > class Foo(Taggable, Noteable): > name = meta.CharField(maxlength=255) > > def __repr__(self): > return self.name > > class META: > admin =

multiple inheritance?

2006-01-31 Thread jason
hi, I want to do something like this: from django.core import meta class Tag(meta.Model): text = meta.CharField(maxlength=255) def __repr__(self): return self.text class META: admin = meta.Admin() class Taggable(meta.Model): tags = meta.ManyToManyField(Tag,