diff --git a/auctions/models.py b/auctions/models.py index 28ba1d6..185edf9 100644 --- a/auctions/models.py +++ b/auctions/models.py @@ -75,3 +75,7 @@ class Watchlist(models.Model): def __str__(self): return f"{self.user} added {self.listing.title} to watchlist" + + def toggle(self): + self.active = not self.active + self.save() diff --git a/auctions/templates/auctions/auction.html b/auctions/templates/auctions/auction.html index b1ffc5f..feabc76 100644 --- a/auctions/templates/auctions/auction.html +++ b/auctions/templates/auctions/auction.html @@ -75,11 +75,11 @@