Update coupon ordering
This commit is contained in:
parent
d0621b2d47
commit
4955bf8dd9
17
src/core/migrations/0003_alter_coupon_options.py
Normal file
17
src/core/migrations/0003_alter_coupon_options.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Generated by Django 4.0.2 on 2022-11-02 00:30
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0002_shippingrate_is_selectable_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='coupon',
|
||||
options={'ordering': ['valid_from', 'valid_to', 'code']},
|
||||
),
|
||||
]
|
||||
17
src/core/migrations/0004_alter_coupon_options.py
Normal file
17
src/core/migrations/0004_alter_coupon_options.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Generated by Django 4.0.2 on 2022-11-02 00:31
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0003_alter_coupon_options'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='coupon',
|
||||
options={'ordering': ['-valid_from', '-valid_to', 'code']},
|
||||
),
|
||||
]
|
||||
@ -226,7 +226,7 @@ class Coupon(models.Model):
|
||||
users = models.ManyToManyField(User, blank=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ("code",)
|
||||
ordering = ['-valid_from', '-valid_to', 'code']
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user