説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

models.py 730B

1234567891011121314151617
  1. from django.conf import settings
  2. from django.db import models
  3. from EditorialModel.migrationhandler.django import DjangoMigrationHandler
  4. from EditorialModel.migrationhandler.dummy import DummyMigrationHandler
  5. from EditorialModel.model import Model
  6. from EditorialModel.backend.json_backend import EmBackendJson
  7. if not settings.LODEL_MIGRATION_HANDLER_TESTS:
  8. me = Model(EmBackendJson('EditorialModel/test/me.json'), migration_handler = DummyMigrationHandler(True))
  9. dmh = DjangoMigrationHandler('LodelTestInstance', settings.DEBUG)
  10. models = dmh.em_to_models(me)
  11. elif settings.DEBUG:
  12. print("Making migrations tests, don't generate the models in the models.py file but within the migrations handler check process")