Commit 7417acfa authored by Michal Čihař's avatar Michal Čihař

Add method for listing translations

parent f244ba39
...@@ -45,12 +45,18 @@ class WeblateCommand(BaseCommand): ...@@ -45,12 +45,18 @@ class WeblateCommand(BaseCommand):
''' '''
Returns list of units matching parameters. Returns list of units matching parameters.
''' '''
subprojects = self.get_subprojects(*args, **options) translations = self.get_translations(*args, **options)
return Unit.objects.filter(translation__subproject__in=subprojects) return Unit.objects.filter(translation__in=translations)
def get_translations(self, *args, **options):
'''
Returns list of translations matching parameters.
'''
return self.get_subprojects.translation_set.all()
def get_subprojects(self, *args, **options): def get_subprojects(self, *args, **options):
''' '''
Returns list of units matching parameters. Returns list of subprojects matching parameters.
''' '''
if options['all']: if options['all']:
# all subprojects # all subprojects
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment