From 7fc8d3202714f58ccd78a2f4eca2415653a1d320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Mon, 26 Jan 2015 18:06:39 +0100 Subject: [PATCH] Adding ordering to webhooklog and webhooks --- taiga/webhooks/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/taiga/webhooks/models.py b/taiga/webhooks/models.py index 0fd212dd..6154b523 100644 --- a/taiga/webhooks/models.py +++ b/taiga/webhooks/models.py @@ -28,6 +28,9 @@ class Webhook(models.Model): url = models.URLField(null=False, blank=False, verbose_name=_("URL")) key = models.TextField(null=False, blank=False, verbose_name=_("secret key")) + class Meta: + ordering = ['name', '-id'] + class WebhookLog(models.Model): webhook = models.ForeignKey(Webhook, null=False, blank=False, @@ -40,3 +43,6 @@ class WebhookLog(models.Model): response_headers = JsonField(null=False, blank=False, verbose_name=_("Response headers"), default={}) duration = models.FloatField(null=False, blank=False, verbose_name=_("Duration"), default=0) created = models.DateTimeField(auto_now_add=True) + + class Meta: + ordering = ['-created', '-id']