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

#1445: Code improvement Gloss Detail context variables #1454

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

susanodd
Copy link
Collaborator

@susanodd susanodd commented Jan 11, 2025

Shared context for Public and Logged In views consolidated

The (original context variable names) context[topic+'_fields'] where topic is in ['phonology', 'semantics', 'main']
have been streamlined.
But the filling in the context is left in the spin-off branch for public so it is clear which fields are being omitted for public view, instead of burying this inside a new, shared called function with a "is_public" extra parameter to distnguish the two branches in the code.

Because the Edit branch needs additional context. This has been split off into separate code in order to make the "topics" code more concise. Specifically, the "choice lists" that used to be inside of this code are now in a separate new function. The used to be nested inside the original "topics" loop. Now this is in a separate function that yields a nested dictionary.

@susanodd susanodd linked an issue Jan 11, 2025 that may be closed by this pull request
Shared context for Public and Logged In views consolidated
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.

Improve code in get_context_data in GlossDetailView
1 participant