Tagging using JS using Partials

This commit is contained in:
2020-08-31 18:18:24 +02:00
parent 66581a9d2d
commit e4cd8bb301
3 changed files with 59 additions and 38 deletions

View File

@@ -13,6 +13,8 @@ from lostplaces_app.models import Place, PlaceImage
from lostplaces_app.views import IsAuthenticated, IsPlaceSubmitter
from lostplaces_app.forms import PlaceForm, PlaceImageCreateForm, TagSubmitForm
from taggit.models import Tag
class PlaceListView(IsAuthenticated, ListView):
paginate_by = 5
model = Place
@@ -31,7 +33,8 @@ class PlaceDetailView(IsAuthenticated, View):
'place': place,
'place_list': [ place ],
'place_map_center': [ place.latitude, place.longitude ],
'tagging_form': TagSubmitForm()
'tagging_form': TagSubmitForm(),
'all_tags': Tag.objects.all()
}
return render(request, 'place/place_detail.html', context)