123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- # -*- coding: utf-8 -*-
- from __future__ import unicode_literals
- from django.db import models, migrations
- from django.utils.translation import ugettext as _
- from misago.conf.migrationutils import migrate_settings_group
- def create_threads_settings_group(apps, schema_editor):
- migrate_settings_group(
- apps,
- {
- 'key': 'threads',
- 'name': _("Threads"),
- 'description': _("Those settings control threads and posts."),
- 'settings': (
- {
- 'setting': 'thread_title_length_min',
- 'name': _("Minimum length"),
- 'description': _("Minimum allowed thread title length."),
- 'legend': _("Thread titles"),
- 'python_type': 'int',
- 'value': 5,
- 'field_extra': {
- 'min_value': 2,
- 'max_value': 255,
- },
- },
- {
- 'setting': 'thread_title_length_max',
- 'name': _("Maximum length"),
- 'description': _("Maximum allowed thread length."),
- 'python_type': 'int',
- 'value': 90,
- 'field_extra': {
- 'min_value': 2,
- 'max_value': 255,
- },
- },
- {
- 'setting': 'post_length_min',
- 'name': _("Minimum length"),
- 'description': _("Minimum allowed user post length."),
- 'legend': _("Posts"),
- 'python_type': 'int',
- 'value': 5,
- 'field_extra': {
- 'min_value': 1,
- },
- },
- {
- 'setting': 'post_length_max',
- 'name': _("Maximum length"),
- 'description': _("Maximum allowed user post length. Enter zero to disable"),
- 'python_type': 'int',
- 'value': 60000,
- 'field_extra': {
- 'min_value': 0,
- },
- },
- )
- })
- class Migration(migrations.Migration):
- dependencies = [
- ('misago_threads', '0001_initial'),
- ('misago_conf', '0001_initial'),
- ]
- operations = [
- migrations.RunPython(create_threads_settings_group),
- ]
|