From 0d17f3696f66b0cb66e560d06ae40d7b87900a8a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 9 Aug 2019 16:12:30 +0200 Subject: Admin: simplify list display of crawl results --- commcrawler/admin.py | 2 +- commcrawler/models.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/commcrawler/admin.py b/commcrawler/admin.py index 6b06228..6365e65 100644 --- a/commcrawler/admin.py +++ b/commcrawler/admin.py @@ -30,7 +30,7 @@ admin_site.register(models.Crawl, CrawlAdmin) class CrawlResultAdmin(admin.ModelAdmin): model = models.CrawlResult list_display = ( - "target", "crawl", "started", "duration", "status", "is_online", + "url", "crawl", "started", "duration", "status", "is_online", "bad_ssl", "nb_external_link", "nb_internal_link", "nb_images", "nb_facebook", "nb_twitter", "nb_instagram", "nb_youtube", "nb_dailymotion", "nb_vimeo", "nb_video", "nb_audio", "nb_internal_pdf", diff --git a/commcrawler/models.py b/commcrawler/models.py index ce3deb0..62d12eb 100644 --- a/commcrawler/models.py +++ b/commcrawler/models.py @@ -141,6 +141,9 @@ class CrawlResult(models.Model): def __str__(self): return "{} - {}".format(self.crawl, self.target) + def url(self): + return self.target.url + class CrawlRelation(models.Model): crawl = models.ForeignKey(Crawl, verbose_name=_("Crawl")) -- cgit v1.2.3