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

Allow customisation of SnippetChooserViewSet #9825

Closed
gassan opened this issue Dec 26, 2022 · 1 comment · Fixed by #10216
Closed

Allow customisation of SnippetChooserViewSet #9825

gassan opened this issue Dec 26, 2022 · 1 comment · Fixed by #10216

Comments

@gassan
Copy link
Contributor

gassan commented Dec 26, 2022

admin_viewset = viewset(
model.get_admin_url_namespace(),
model=model,
url_prefix=model.get_admin_base_path(),
)
chooser_viewset = SnippetChooserViewSet(
f"wagtailsnippetchoosers_{model._meta.app_label}_{model._meta.model_name}",
model=model,
url_prefix=f"snippets/choose/{model._meta.app_label}/{model._meta.model_name}",
)

I have one special snipped model and would like to show all >300 elements on a single page bypassing paginator (inline-block).

@laymonage laymonage changed the title maybe chooser_viewset should become configurable too? Allow customisation of SnippetChooserViewSet Mar 17, 2023
@laymonage
Copy link
Member

Thank you for the suggestion! After #10216, this is possible by overriding SnippetViewSet.chooser_viewset.

In addition, we'll also allow easier customisation of the number of items to be shown on both the listing and chooser views by setting the attributes directly in SnippetViewSet in #10241.

For more details regarding our plans for these customisations, please see #10206. We'd love to hear your feedback!

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

Successfully merging a pull request may close this issue.

2 participants