backend/passfinder/recomendations/models.py

34 lines
1.6 KiB
Python
Raw Normal View History

2023-05-21 13:37:21 +03:00
from django.db import models
from passfinder.users.models import User
2023-05-23 17:51:01 +03:00
from passfinder.events.models import Event, Hotel
2023-05-21 13:37:21 +03:00
class UserPreferences(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
preffered_plays = models.ManyToManyField(Event, related_name='preffered_user_play')
2023-05-21 17:13:16 +03:00
unpreffered_plays = models.ManyToManyField(Event, related_name='unpreffered_users_play')
2023-05-21 13:37:21 +03:00
preffered_movies = models.ManyToManyField(Event, related_name='preffered_user_movie')
unpreffered_movies = models.ManyToManyField(Event, related_name='unpreffered_user_movie')
preferred_concerts = models.ManyToManyField(Event, related_name='preffered_users_concert')
2023-05-22 22:37:54 +03:00
unpreferred_concerts = models.ManyToManyField(Event, related_name='unpreffered_users_concert')
2023-05-24 17:58:51 +03:00
prefferred_attractions = models.ManyToManyField(Event, related_name='preffered_users_attractions')
unprefferred_attractions = models.ManyToManyField(Event, related_name='unpreffered_users_attractions')
prefferred_museums = models.ManyToManyField(Event, related_name='preffered_users_museums')
unprefferred_museums = models.ManyToManyField(Event, related_name='unpreffered_users_museums')
2023-05-22 22:37:54 +03:00
class NearestEvent(models.Model):
event = models.ForeignKey(Event, on_delete=models.CASCADE, related_name='nearest_model_rel')
2023-05-23 17:51:01 +03:00
nearest = models.ManyToManyField(Event, related_name='nearest_model_rev_rel')
class NearestHotel(models.Model):
hotel = models.ForeignKey(Hotel, on_delete=models.CASCADE, related_name='nearest_hotel_rel')
nearest_events = models.ManyToManyField(Event, related_name='nearest_hotel_rev_rel')