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

Add optional "ordering" parameter to Section() and BasePreferenceType() for easier #90

Open
leetucker opened this issue Aug 11, 2017 · 2 comments

Comments

@leetucker
Copy link

Right now, both sections and preferences are listed in the order in which they are discovered and loaded into the dynamic preferences registry. However, in a project with multiple apps, it is not always possible to order the apps in INSTALLED_APPS so that the sections and individual preferences show up in a sensible order. It is not necessarily desirable to build a form that explicitly orders these preferences, either, since that creates dependencies between otherwise independent apps. Having some more direct control over the display order of both sections and individual preferences would be particularly helpful in these instances.

Default behavior should probably be that preferences without an explicit order value are either displayed last, or (perhaps preferably) are assigned a specific value, so that preferences can be easily ordered to show up either first or last without requiring the ordering to be explicitly defined for each preference. Ties can be broken in the order of discovery, so the existing ordering is preserved in the default situation of no order parameters specified.

@agateblue
Copy link
Owner

I have to double check this, but I think the current order is the app discovery order then the preference discovery order, when using the form builder. In the django admin interface, I can't find any explicit ordering, so the default order probably apply: most recent objects first. However, if you use the form builder and provide explicit preferences, the field order should match the order of preferences you passed to the function

This is a valid request, and we could also imagine making the default order customizable : by section/preference label, by discovery order, using the explicit order defined on the section or preference object...

I'll be on a vacation from sunday up until september 2nd and I won't be able to work on it or review anything during that time. Feel free to work on this if you feel like it, I'd be glad to help you and give you some feedback as soon as I get back :)

@zbynekdrlik
Copy link

+1

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

3 participants