0002_create_default_theme.py 658 B

12345678910111213141516171819202122232425262728
  1. # Generated by Django 1.11.16 on 2018-12-26 16:11
  2. from django.db import migrations
  3. from .. import THEME_CACHE
  4. from ...cache.operations import StartCacheVersioning
  5. def create_default_theme(apps, schema_editor):
  6. Theme = apps.get_model("misago_theming", "Theme")
  7. Theme.objects.create(
  8. name="default",
  9. is_default=True,
  10. is_active=True,
  11. lft=1,
  12. rght=2,
  13. tree_id=0,
  14. level=0,
  15. )
  16. class Migration(migrations.Migration):
  17. dependencies = [("misago_theming", "0001_initial")]
  18. operations = [
  19. StartCacheVersioning(THEME_CACHE),
  20. migrations.RunPython(create_default_theme),
  21. ]