0002_db_settings.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 it's name or description."),
  18. 'settings': (
  19. {
  20. 'setting': 'forum_name',
  21. 'name': _("Forum name"),
  22. 'value': "Misago",
  23. 'field_extra': {
  24. 'min_length': 2,
  25. 'max_length': 255
  26. },
  27. },
  28. {
  29. 'setting': 'forum_index_title',
  30. 'name': _("Forum index title"),
  31. 'description': _("You may set custon title on "
  32. "forum index by typing it here."),
  33. 'legend': _("Forum index"),
  34. 'field_extra': {
  35. 'max_length': 255
  36. },
  37. },
  38. {
  39. 'setting': 'forum_index_meta_description',
  40. 'name': _("Forum index Meta Description"),
  41. 'description': _("Short description of your forum "
  42. "for internet crawlers."),
  43. 'field_extra': {
  44. 'max_length': 255
  45. },
  46. },
  47. )
  48. },
  49. )
  50. def backwards(self, orm):
  51. "Write your backwards methods here."
  52. models = with_conf_models('0001_initial')
  53. complete_apps = ['core']
  54. symmetrical = True
  55. depends_on = (
  56. ("conf", "0001_initial"),
  57. )