0002_country_continent_borders_initial_data.py 文件源码

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

项目:grical 作者: wikical 项目源码 文件源码
def load_fixture(apps, schema_editor):
    from django.conf import settings
    if settings.TESTS_RUNNING:
        # Currently we don't have any test relying to borders, we skip
        # to accelerate tests
        return

    fixture_file = os.path.join(fixture_dir, fixture_filename)

    with open(fixture_file) as fixture:
        objects = serializers.deserialize('json', fixture, ignorenonexistent=True)
        for obj in objects:
            obj.save()

# Most probably we won't add some revertion code to go to 0001, so this code
# won't execute ever and I take it out for coverage. At some point we may
# delete. Stefanos 2015-10-12 16:46:00+03:00
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号