diff options
Diffstat (limited to 'app/ebay/models.py')
-rw-r--r-- | app/ebay/models.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/ebay/models.py b/app/ebay/models.py index f361b7a..fd5d0a3 100644 --- a/app/ebay/models.py +++ b/app/ebay/models.py @@ -37,16 +37,21 @@ class TrackedItem(models.Model): ordering = ('date_ending', 'amount_desired') get_latest_by = 'date_ending' - def save(self, **kwargs): - super(TrackedItem, self).save() - @property def get_latest_price(self): return self.price_set.latest().price + def admin_link(self): + return force_text('<a href="%s">View Auction page</a>' % (self.url)) + admin_link.allow_tags = True + admin_link.short_description = 'Link' + def __str__(self): return self.title + def save(self, **kwargs): + super(TrackedItem, self).save() + class Price(models.Model): date = models.DateTimeField(blank=True) |