diff --git a/organization/core/migrations/0015_auto_20230906_1448.py b/organization/core/migrations/0015_auto_20230906_1448.py new file mode 100644 index 00000000..fc2e3f9d --- /dev/null +++ b/organization/core/migrations/0015_auto_20230906_1448.py @@ -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'), + ), + ] diff --git a/organization/core/models.py b/organization/core/models.py index 4565ee08..ae9e8dcf 100644 --- a/organization/core/models.py +++ b/organization/core/models.py @@ -229,7 +229,7 @@ class Meta: abstract = True -class MetaCategory(Named, Orderable): +class MetaCategory(Named): """Meta Category""" featured = models.BooleanField(default=False) @@ -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