This commit is contained in:
Anatoly 2020-01-29 16:59:10 +03:00
parent 4fde19d23e
commit 302e22045e
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ urlpatterns = [
name='create-comment'),
path('slug/<slug:slug>/comments/<int:comment_id>/', views.EstablishmentCommentRUDView.as_view(),
name='rud-comment'),
path('slug/<slug:slug>/collections/', views.EstablishmentFavoritesCreateDestroyView.as_view(),
path('slug/<slug:slug>/favorites/', views.EstablishmentFavoritesCreateDestroyView.as_view(),
name='create-destroy-favorites'),
# similar establishments by type/subtype

View File

@ -178,12 +178,12 @@ class City(models.Model, TranslatedFieldsMixin):
verbose_name = _('city')
def __str__(self):
return self.name
return self.name_dumped
@property
def name_dumped(self):
"""Used for indexing as string"""
return dumps(self.name)
return f'{self.id}: {dumps(self.name)}'
@property
def image_object(self):