From 6c4e3fde6e2350aa8fa0264efc88990307d1b7b9 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 25 Nov 2018 20:38:49 +0100 Subject: [PATCH] core: add order to rule --- passbook/core/migrations/0003_rule_order.py | 18 ++++++++++++++++++ passbook/core/models.py | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 passbook/core/migrations/0003_rule_order.py diff --git a/passbook/core/migrations/0003_rule_order.py b/passbook/core/migrations/0003_rule_order.py new file mode 100644 index 000000000..236896606 --- /dev/null +++ b/passbook/core/migrations/0003_rule_order.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.3 on 2018-11-25 19:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('passbook_core', '0002_auto_20181125_1638'), + ] + + operations = [ + migrations.AddField( + model_name='rule', + name='order', + field=models.IntegerField(default=0), + ), + ] diff --git a/passbook/core/models.py b/passbook/core/models.py index 8a90a2236..ec3524a12 100644 --- a/passbook/core/models.py +++ b/passbook/core/models.py @@ -22,6 +22,8 @@ class User(AbstractUser): class Provider(models.Model): """Application-independent Provider instance. For example SAML2 Remote, OAuth2 Application""" + objects = InheritanceManager() + # This class defines no field for easier inheritance def __str__(self): if hasattr(self, 'name'): @@ -102,6 +104,7 @@ class Rule(UUIDModel, CreatedUpdatedModel): name = models.TextField(blank=True, null=True) action = models.CharField(max_length=20, choices=ACTIONS) negate = models.BooleanField(default=False) + order = models.IntegerField(default=0) objects = InheritanceManager()