collectstatic_js_choices.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:django-js-choices 作者: lorinkoz 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号