django-generic-relations Questions

1

I have models with GenricForeigKey and GenericRelation fields. class Datasheet(models.Model): package1 = GenericRelation('PackageInstance') ... class PackageInstance(models.Model): content_ob...

1

I am trying to restrict GFK to be pointed to objects of a few models only, and I thought CheckConstraint will be a great way to do this, however I get this error class ManualAdjustment(Model): co...

2

Solved

I'm getting started with Django and I'm a bit stuck on a multi-models field, AKA Generic Relation (Content Type) I have a generic content type "student_solution" that can belong to either...

2

Solved

When using GenericForeignKey together with UUIDField, what is the recommended way to get a queryset of the "real model" from a queryset of generic objects? Here are the models I'm testing with: ...
Huguenot asked 25/5, 2018 at 10:16

2

Solved

I must be really misunderstanding something with the GenericRelation field from Django's content types framework. To create a minimal self contained example, I will use the polls example app from ...
1

© 2022 - 2024 — McMap. All rights reserved.