def handle(self, *args, **options):
locale = options['locale']
location = self.get_location()
file = 'choices-{}.js'.format(locale)
fs = FileSystemStorage(location=location)
if fs.exists(file):
fs.delete(file)
content = generate_js(locale)
fs.save(file, ContentFile(content))
if len(sys.argv) > 1 and sys.argv[1] in ['collectstatic_js_choices']:
self.stdout.write('{0} file written to {1}'.format(file, location))
collectstatic_js_choices.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录