Skip to content

Commit

Permalink
fix MetaCategory order
Browse files Browse the repository at this point in the history
  • Loading branch information
yomguy committed Sep 6, 2023
1 parent 63a7e68 commit ffc3ae4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
26 changes: 26 additions & 0 deletions organization/core/migrations/0015_auto_20230906_1448.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 3.2.19 on 2023-09-06 12:48

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('organization_core', '0014_metacategory_icon_id'),
]

operations = [
migrations.AlterModelOptions(
name='metacategory',
options={'ordering': ['order'], 'verbose_name': 'Category', 'verbose_name_plural': 'Categories'},
),
migrations.RemoveField(
model_name='metacategory',
name='_order',
),
migrations.AddField(
model_name='metacategory',
name='order',
field=models.IntegerField(default=0, verbose_name='order'),
),
]
7 changes: 6 additions & 1 deletion organization/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class Meta:
abstract = True


class MetaCategory(Named, Orderable):
class MetaCategory(Named):
"""Meta Category"""

featured = models.BooleanField(default=False)
Expand All @@ -244,10 +244,15 @@ class MetaCategory(Named, Orderable):
blank=True,
max_length=128
)
order = models.IntegerField(
_("order"),
default=0
)

class Meta:
verbose_name = _('Category')
verbose_name_plural = _('Categories')
ordering = ['order']

def __str__(self):
return self.name
Expand Down

0 comments on commit ffc3ae4

Please sign in to comment.