diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/deals/admin.py | 2 | ||||
-rw-r--r-- | app/deals/models.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/deals/admin.py b/app/deals/admin.py index 264ff3d..dcf629f 100644 --- a/app/deals/admin.py +++ b/app/deals/admin.py @@ -9,7 +9,7 @@ from .models import Deal @admin.register(Deal) class DealAdmin(OSMGeoAdmin): - list_display = ('brand', 'title', 'category', 'deal_price', 'original_price', 'discount_percent', 'promo_type', 'amazon_link', 'search_wired', 'get_airtable_code') + list_display = ('brand', 'title', 'category', 'deal_price', 'original_price', 'discount_percent', 'promo_type', 'amazon_link', 'search_ccc', 'search_wired', 'get_airtable_code') search_fields = ['brand', 'title', ] list_filter = ('category', 'promo_type', ('brand', DropdownFilter),) diff --git a/app/deals/models.py b/app/deals/models.py index dde4465..f3c3e12 100644 --- a/app/deals/models.py +++ b/app/deals/models.py @@ -32,7 +32,7 @@ class Deal(models.Model): return "{:.0f}".format(Decimal(self.deal_price)) def amazon_link(self): - return format_html('<a target="_blank" href="%s">%s</a>' % (self.url, self.url)) + return format_html('<a target="_blank" href="%s">Amazon</a>' % (self.url)) admin_link.short_description = 'Link' def search_wired(self): @@ -44,6 +44,11 @@ class Deal(models.Model): def get_airtable_code(self): return format_html("<a target='_blank' href='/code/%s'>Get code</a>" % (self.pk)) admin_link.short_description = 'Link' + + def search_ccc(self): + return format_html("<a target='_blank' href='https://camelcamelcamel.com/product/%s'>Deal?</a>" % (self.asin)) + admin_link.short_description = 'Link' + """ |