Commit 73cbfd3e authored by Skia's avatar Skia

Add Forum ordering number

parent ffbad7e2
Pipeline #790 passed with stage
in 3 minutes and 57 seconds
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='forum',
options={'ordering': ['number']},
),
migrations.AddField(
model_name='forum',
name='number',
field=models.IntegerField(verbose_name='number to choose a specific forum ordering', default=1),
),
migrations.AlterField(
model_name='forum',
name='edit_groups',
field=models.ManyToManyField(related_name='editable_forums', blank=True, to='core.Group', default=[331]),
),
]
...@@ -32,6 +32,10 @@ class Forum(models.Model): ...@@ -32,6 +32,10 @@ class Forum(models.Model):
default=[settings.SITH_GROUP_OLD_SUBSCRIBERS_ID]) default=[settings.SITH_GROUP_OLD_SUBSCRIBERS_ID])
view_groups = models.ManyToManyField(Group, related_name="viewable_forums", blank=True, view_groups = models.ManyToManyField(Group, related_name="viewable_forums", blank=True,
default=[settings.SITH_GROUP_PUBLIC_ID]) default=[settings.SITH_GROUP_PUBLIC_ID])
number = models.IntegerField(_("number to choose a specific forum ordering"), default=1)
class Meta:
ordering = ['number']
def clean(self): def clean(self):
self.check_loop() self.check_loop()
......
...@@ -43,7 +43,7 @@ class ForumLastUnread(ListView): ...@@ -43,7 +43,7 @@ class ForumLastUnread(ListView):
class ForumForm(forms.ModelForm): class ForumForm(forms.ModelForm):
class Meta: class Meta:
model = Forum model = Forum
fields = ['name', 'parent', 'owner_club', 'is_category', 'edit_groups', 'view_groups'] fields = ['name', 'parent', 'number', 'owner_club', 'is_category', 'edit_groups', 'view_groups']
edit_groups = make_ajax_field(Forum, 'edit_groups', 'groups', help_text="") edit_groups = make_ajax_field(Forum, 'edit_groups', 'groups', help_text="")
view_groups = make_ajax_field(Forum, 'view_groups', 'groups', help_text="") view_groups = make_ajax_field(Forum, 'view_groups', 'groups', help_text="")
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment