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

feat(scopes): denormalize full_name and use it for sorting #408

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

winged
Copy link
Contributor

@winged winged commented Sep 23, 2022

The full_name attribute on the Scopes was dynamically generated on access. This is rather inefficient, as it may cause a bunch of DB hits, especially in deep hierarchies.

Additionally, most of the time we want scopes to be sorted in a meaningful manner (namely, by hierarchical name). MPTTModel supports this, but as the ordering may differ between languages, we cannot use that functionality. This is a secondary use of the denormalized full_name.

This also required a fix in the case insensitive ordering code, as localized fields were not treated correctly yet (casting directly to text instead of extracting the correct language and using that to sort)

The full_name attribute on the Scopes was dynamically generated on access.
This is rather inefficient, as it may cause a bunch of DB hits, especially
in deep hierarchies.

Additionally, most of the time we want scopes to be sorted in a
meaningful manner (namely, by hierarchical name). MPTTModel supports
this, but as the ordering may differ between languages, we cannot use
that functionality. This is a secondary use of the denormalized full_name.

This also required a fix in the case insensitive ordering code, as
localized fields were not treated correctly yet (casting directly to
text instead of extracting the correct language and using that to sort)
@winged winged force-pushed the feat_denormalized_scope_names branch from f1b1641 to 4921028 Compare September 23, 2022 12:44
Copy link
Member

@open-dynaMIX open-dynaMIX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@winged winged merged commit 6e35242 into projectcaluma:main Sep 23, 2022
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 this pull request may close these issues.

2 participants