Django abstract models with M2M fields?

The answer is right in the docs for abstract classes (under section entitled "Be careful with related_name ").

Up vote 0 down vote favorite share g+ share fb share tw.

Let's suppose I have the following: class Base(Model): m2m_1 = ManyToManyField("SomeModel1") m2m_2 = ManyToManyField("SomeModel2") class Meta: abstract = True class A(Base): def __init__(self): super(A, self). __init__() pass class B(Base): def __init__(self): super(B, self). __init__() pass However, I cannot do that because it requires related name for M2M field.

However, that does not help as the model is abstract and django tries to create the same related name for both A and B models. Any ideas how to specify related names for each model separately or even do not use them at all? Django many-to-many link|improve this question asked Dec 8 '11 at 20:37Hvandracas1688 58% accept rate.

The answer is right in the docs for abstract classes (under section entitled "Be careful with related_name"): m2m = models. ManyToManyField(OtherModel, related_name="%(app_label)s_%(class)s_related").

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions