-
-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
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
Proxy Model Support - Creating base class and querying for proxy model does not return results #390
Comments
We're also encountering this issue. :( Any updates on this? |
Any updates?? |
This is by design. For now you can work around this by overriding the manager's class MyModelManager(PolymorphicManager):
def get_queryset(self):
qs = self.queryset_class(self.model, using=self._db, hints=self._hints)
return qs
class MyModel(models.Usuario):
objects = MyModelManager()
class Meta:
proxy = True |
pgammans
pushed a commit
to bva-icx/django-polymorphic
that referenced
this issue
Jun 26, 2023
pgammans
added a commit
to bva-icx/django-polymorphic
that referenced
this issue
Apr 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
First off thanks for creating this package!
I am running into an issue now where we needed to create two different admin pages and creating proxy models seems like a good idea to use the same model have this separation or grouping. However, when registering the proxy models to their own separate ModelAdmins, the get_queryset() returns an empty set and results are not shown.
I've posted on SO
When I tried creating the object using the regular Django Model class, I am able to query the proxy model and get the created object.
However, when I use the PolymorphicModel and query for proxy model, the queryset is empty.
Shouldn't we expect the Queryset to contain the Person object we created?
The text was updated successfully, but these errors were encountered: