0002_db_settings.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 with_conf_models, migrate_settings_group
  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 of "
  17. "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. def backwards(self, orm):
  50. "Write your backwards methods here."
  51. models = with_conf_models('0001_initial')
  52. complete_apps = ['core']
  53. symmetrical = True
  54. depends_on = (
  55. ("conf", "0001_initial"),
  56. )