Commit da32675f authored by Michal Čihař's avatar Michal Čihař

Command line interface for force update

parent ee76af5f
from django.core.management.base import BaseCommand, CommandError
from trans.models import SubProject
from optparse import make_option
class Command(BaseCommand):
help = '(re)loads translations from disk'
args = '<project/subproject>'
option_list = BaseCommand.option_list + (
make_option('--force',
action='store_true',
dest='force',
default=False,
help='Force rereading files even when they should be up to date'),
)
def handle(self, *args, **options):
for arg in args:
prj, subprj = arg.split('/')
SubProject.objects.get(slug = subprj, project__slug = prj).create_translations()
s = SubProject.objects.get(slug = subprj, project__slug = prj)
s.create_translations(options['force'])
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