Add URLs for wishlist models

newer-dal
LEdoian 4 years ago
parent 1e3db9b7b5
commit d8a8c80bb0

@ -13,6 +13,9 @@ class WishList(models.Model):
hide_granted = models.BooleanField(default=False, help_text="Whether to hide already fulfilled wishes.") hide_granted = models.BooleanField(default=False, help_text="Whether to hide already fulfilled wishes.")
def __str__(self): return self.name def __str__(self): return self.name
def get_absolute_url(self):
from django.urls import reverse
return reverse('wishlist', kwargs={'slug':self.slug})
class WishedItem(models.Model): class WishedItem(models.Model):
@ -24,6 +27,9 @@ class WishedItem(models.Model):
wishlists = models.ManyToManyField(WishList, related_name='wishes', help_text="Wishlists that this wish should be part of.") wishlists = models.ManyToManyField(WishList, related_name='wishes', help_text="Wishlists that this wish should be part of.")
def __str__(self): return self.name def __str__(self): return self.name
def get_absolute_url(self):
from django.urls import reverse
return reverse('wished_item', kwargs={'pk': self.id})
# FIXME: create more sensible name... # FIXME: create more sensible name...
class DreamComeTrue(models.Model): class DreamComeTrue(models.Model):

Loading…
Cancel
Save