Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Order transactions by database ID

Marcin Gębalaf477c222ef9b
diff --git a/saleor/payment/migrations/0007_auto_20190206_0938.py b/saleor/payment/migrations/0007_auto_20190206_0938.py
new file mode 100644
index 0000000000..d1d2c7d576
--- /dev/null
+++ b/saleor/payment/migrations/0007_auto_20190206_0938.py
@@ -0,0 +1,17 @@
+# Generated by Django 2.1.5 on 2019-02-06 15:38
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('payment', '0006_auto_20190109_0358'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='transaction',
+ options={'ordering': ('pk',)},
+ ),
+ ]
diff --git a/saleor/payment/models.py b/saleor/payment/models.py
index 579265dfe4..beb6f00627 100644
--- a/saleor/payment/models.py
+++ b/saleor/payment/models.py
@@ -179,6 +179,9 @@ class Transaction(models.Model):
max_length=256, null=True)
gateway_response = JSONField(encoder=DjangoJSONEncoder)
+ class Meta:
+ ordering = ('pk', )
+
def __repr__(self):
return 'Transaction(type=%s, is_success=%s, created=%s)' % (
self.kind, self.is_success, self.created)