0002_db_settings.py 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. 'setting': 'email_footer',
  50. 'name': _("E-mails footer"),
  51. 'description': _("Optional short message included "
  52. "at the end of e-mails sent by "
  53. "forum"),
  54. 'legend': _("Forum e-mails"),
  55. 'field_extra': {
  56. 'max_length': 255
  57. },
  58. },
  59. )
  60. },
  61. )
  62. def backwards(self, orm):
  63. "Write your backwards methods here."
  64. models = with_conf_models('0001_initial')
  65. complete_apps = ['core']
  66. symmetrical = True
  67. depends_on = (
  68. ("conf", "0001_initial"),
  69. )