filtering events
This commit is contained in:
@@ -106,7 +106,7 @@ class EventPrincipalInteraction(models.Model):
|
||||
)
|
||||
|
||||
class Meta:
|
||||
unique_together = ("principal", "event", "status")
|
||||
unique_together = ("principal", "event")
|
||||
|
||||
|
||||
class PrincipalPreference(BaseModel):
|
||||
@@ -120,3 +120,14 @@ class PrincipalPreference(BaseModel):
|
||||
|
||||
class Meta:
|
||||
db_table = "user_preference"
|
||||
|
||||
|
||||
class Favorites(models.Model):
|
||||
principal = models.ForeignKey(IAmPrincipal, on_delete=models.CASCADE, related_name='favorited_by')
|
||||
event = models.ForeignKey(Event, on_delete=models.CASCADE, related_name='favorites')
|
||||
|
||||
class Meta:
|
||||
unique_together = ('principal', 'event')
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.principal}'s favorite: {self.event.title}"
|
||||
|
||||
Reference in New Issue
Block a user