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

Denormalize: Add a translation_project field to Directory #4425

Open
unho opened this issue Jan 25, 2016 · 0 comments
Open

Denormalize: Add a translation_project field to Directory #4425

unho opened this issue Jan 25, 2016 · 0 comments
Labels
Milestone

Comments

@unho
Copy link
Member

unho commented Jan 25, 2016

This will allow to get rid of some ugly code. Directories probably won't change TP and this will allow to simplify some queries like

"%stranslationproject" % tp_prefix,
"%stranslationproject" % tp_prefix,
"%stranslationproject__language" % tp_prefix]
or
@cached_property
def translation_project(self):
"""Returns the translation project belonging to this directory."""
if self.is_language() or self.is_project():
return None
if self.is_translationproject():
return self.translationproject
aux_dir = self
while not aux_dir.is_translationproject() and aux_dir.parent is not None:
aux_dir = aux_dir.parent
return aux_dir.translationproject

@unho unho added the cleanup label Jan 25, 2016
@phlax phlax added this to the 2.8.1 milestone Feb 17, 2016
@unho unho removed their assignment Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants