Hi,
I want to use it like this:
"""
class PersistentModel(models.Model):
deleted = models.BooleanField(default = False)
date_created = models.DateTimeField(default=datetime.now)
date_edited = models.DateTimeField(default=datetime.now)
owner = models.ForeignKey(User)
class Contacts
I think that if you want make inheritance it is because you want to
have others subclasses. But then, your related name will be same for
all the subclasses.
There is no solution with the stable version. In the dev version, it
is possible to add the origin class name in the related_name. It is
What I want is to "automatic" add an owner to every object..
Is there another way to accomplish the same?
Fredrik
On Apr 3, 10:48 pm, Thierry Chich wrote:
> I think that if you want make inheritance it is because you want to
> have others subclasses. But then, your related name will be same
Le 3 avr. 2010 à 23:37, Fredrik a écrit :
What I want is to "automatic" add an owner to every object..
Is there another way to accomplish the same?
I see. I have had a similar problem. I have tried a similar solution
with exactly the same effect.
I could have add manualy a foreignkey
On Apr 3, 10:37 pm, Fredrik wrote:
> What I want is to "automatic" add an owner to every object..
>
> Is there another way to accomplish the same?
>
> Fredrik
>
Do you need the PersistentModel field to exist in a separate table? It
sounds to me as if that would be better off as an abstract model.
You are right but it would not change his problem. If 2 or more
classes inherit from a class with a foreignkey or a manytomany, there
will be a conflict in the related name
Le 4 avr. 2010 à 14:11, Daniel Roseman a
écrit :
On Apr 3, 10:37 pm, Fredrik wrote:
What I want is to "automat
6 matches
Mail list logo