0002_db_settings.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # -*- coding: utf-8 -*-
  2. from south.utils import datetime_utils as datetime
  3. from south.db import db
  4. from south.v2 import DataMigration
  5. from django.db import models
  6. from misago.conf.migrationutils import migrate_settings_group, with_conf_models
  7. from misago.core.migrationutils import ugettext_lazy as _
  8. class Migration(DataMigration):
  9. def forwards(self, orm):
  10. "Write your forwards methods here."
  11. migrate_settings_group(
  12. orm,
  13. {
  14. 'key': 'basic',
  15. 'name': _("Basic forum settings"),
  16. 'description': _("Those settings control most basic properties "
  17. "of your forum like its name or description."),
  18. 'settings': (
  19. {
  20. 'setting': 'forum_name',
  21. 'name': _("Forum name"),
  22. 'legend': _("General"),
  23. 'value': "Misago",
  24. 'field_extra': {
  25. 'min_length': 2,
  26. 'max_length': 255
  27. },
  28. },
  29. {
  30. 'setting': 'forum_index_title',
  31. 'name': _("Forum index title"),
  32. 'description': _("You may set custon title on "
  33. "forum index by typing it here."),
  34. 'legend': _("Forum index"),
  35. 'field_extra': {
  36. 'max_length': 255
  37. },
  38. },
  39. {
  40. 'setting': 'forum_index_meta_description',
  41. 'name': _("Forum index Meta Description"),
  42. 'description': _("Short description of your forum "
  43. "for internet crawlers."),
  44. 'field_extra': {
  45. 'max_length': 255
  46. },
  47. },
  48. )
  49. },
  50. )
  51. def backwards(self, orm):
  52. "Write your backwards methods here."
  53. models = with_conf_models('0001_initial')
  54. complete_apps = ['core']
  55. symmetrical = True
  56. depends_on = (
  57. ("conf", "0001_initial"),
  58. )