We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am attempting to adjust code I have already written to work with polymorphic-tree and am failing to get it working.
Base setup is
ParentModel(PolymorphicMPTTModel): parent = PolymorphicTreeForeignKey('self', blank=True, null=True, related_name='children', verbose_name=_('parent'), on_delete=models.CASCADE ) some_date = models.TextField(null=True)
ChildModel(ParentModel): child_data = blah
Grandchild1Model(ChildModel): data = blah
Grandchild2Model(ChildModel): data = blah
I have tried something along the lines of
d, created = ParentModel.objects.update_or_create(some_date=blah) d2, create = ChildModel.objects.update_or_create(child_data=blah, parent = d)
This however does not seem to work. Any tips would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am attempting to adjust code I have already written to work with polymorphic-tree and am failing to get it working.
Base setup is
ParentModel(PolymorphicMPTTModel):
parent = PolymorphicTreeForeignKey('self', blank=True, null=True, related_name='children', verbose_name=_('parent'),
on_delete=models.CASCADE
)
some_date = models.TextField(null=True)
ChildModel(ParentModel):
child_data = blah
Grandchild1Model(ChildModel):
data = blah
Grandchild2Model(ChildModel):
data = blah
I have tried something along the lines of
d, created = ParentModel.objects.update_or_create(some_date=blah)
d2, create = ChildModel.objects.update_or_create(child_data=blah, parent = d)
This however does not seem to work. Any tips would be greatly appreciated.
The text was updated successfully, but these errors were encountered: