Skip to content
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

How to suggest a selection at dropdown menu on the admin site #785

Open
bauergeorg opened this issue Aug 23, 2022 · 2 comments
Open

How to suggest a selection at dropdown menu on the admin site #785

bauergeorg opened this issue Aug 23, 2022 · 2 comments

Comments

@bauergeorg
Copy link

Hi folks,

I am try to suggest my favorite permission at admin site when adding a permission (dop down menu). How can I do that?

image

admin.py

class DeploymentUserObjectPermissionAdmin(GuardedModelAdmin):
    list_display = ('permission', 'user', 'content_object')
    search_fields = ('permission', 'user', 'content_object')
    ordering = ('-permission',

models.py

class DeploymentUserObjectPermission(UserObjectPermissionBase):
    content_object = models.ForeignKey(Deployment, on_delete=models.CASCADE)
@bauergeorg
Copy link
Author

And another additional question: How could I filter the permission selection?

@bauergeorg
Copy link
Author

added to stackoverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant