Model for favorite system
This commit is contained in:
parent
4bacd1a28d
commit
abca946883
@ -14,6 +14,7 @@ from django.db.models.signals import post_save
|
|||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
|
||||||
from lostplaces.models.abstract_models import Expireable
|
from lostplaces.models.abstract_models import Expireable
|
||||||
|
from lostplaces.models.place import Place
|
||||||
|
|
||||||
class Explorer(models.Model):
|
class Explorer(models.Model):
|
||||||
"""
|
"""
|
||||||
@ -27,6 +28,8 @@ class Explorer(models.Model):
|
|||||||
related_name='explorer'
|
related_name='explorer'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
favorite_places = models.ManyToManyField(Place, related_name='favorite_places', verbose_name='Explorers favorite places')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.user.username
|
return self.user.username
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user