Open ghost opened 9 years ago
Hey I've got it to work but when I created the 'mobile/directory/venue_index.html and venue_list.html it doesn't use the templates. Sure it's some small thing I just missed.
class VenueList(JSONResponseMixin, MultipleObjectTemplateResponseMixin, BaseListView): model = Venue paginate_by = 20 context_object_name = 'venues' category = None slug_level = "" area = None template_name = 'directory/venue_index.html' def get_queryset(self): if self.request.is_mobile: qs = Venue.objects.filter(visible=True,).order_by('-hot', '-created') if self.kwargs.get('category', None): self.template_name = 'directory/venue_list.html' slugs = self.kwargs['category'].strip('/').split('/') self.category = get_object_or_404(Category, slug=slugs[-1]) qs = qs.filter(categories__in=self.category.get_descendants(include_self=True)) if self.kwargs.get('area', None): self.template_name = 'directory/venue_list.html' self.template_name = 'directory/venue_list.html' slugs = self.kwargs['area'].strip('/').split('/') self.area = get_object_or_404(Area, slug=slugs[-1]) qs = qs.filter(area__in=self.area.get_descendants(include_self=True)) if self.request.META.get('HTTP_ACCEPT', None) == 'application/json': qs = qs.filter(longitude__isnull=False, latitude__isnull=False).exclude(longitude=0, latitude=0).order_by('name') self.queryset = qs.distinct() return self.queryset
Hey, have you added django_mobile.loader.Loader as first item to your TEMPLATE_LOADERS setting?
django_mobile.loader.Loader
TEMPLATE_LOADERS
Hey I've got it to work but when I created the 'mobile/directory/venue_index.html and venue_list.html it doesn't use the templates. Sure it's some small thing I just missed.