Define string representations for wishlist models

newer-dal
LEdoian 4 years ago
parent a50fb8ce24
commit 2fe939460b

@ -12,6 +12,8 @@ class WishList(models.Model):
hidden = models.BooleanField(default=True, help_text="Whether to hide on the users' list of their wishlists.") hidden = models.BooleanField(default=True, help_text="Whether to hide on the users' list of their wishlists.")
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
class WishedItem(models.Model): class WishedItem(models.Model):
# Meta class? # Meta class?
@ -21,6 +23,8 @@ class WishedItem(models.Model):
description = models.TextField(blank=True, help_text="Detailed description of the item, for example its specification.") description = models.TextField(blank=True, help_text="Detailed description of the item, for example its specification.")
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
# FIXME: create more sensible name... # FIXME: create more sensible name...
class DreamComeTrue(models.Model): class DreamComeTrue(models.Model):
@ -28,3 +32,4 @@ class DreamComeTrue(models.Model):
when = models.DateTimeField(auto_now_add=True, help_text="When the dream came true") when = models.DateTimeField(auto_now_add=True, help_text="When the dream came true")
note = models.TextField(blank=True, help_text="Optional note, e.g. tracking number. Private, shown only to owner.") note = models.TextField(blank=True, help_text="Optional note, e.g. tracking number. Private, shown only to owner.")
def __str__(self): return f"Dream of {self.item} came true on {self.when}"

Loading…
Cancel
Save