Adding ordering to webhooklog and webhooks

remotes/origin/enhancement/email-actions
Jesús Espino 2015-01-26 18:06:39 +01:00
parent 955a80213a
commit 7fc8d32027
1 changed files with 6 additions and 0 deletions

View File

@ -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']