I have two snap of code below.  I want to know that in the first one I used 
template_name='restaurants/restaurants_list.html' which is obvious if I 
want to use a template but in the second one I have not specified the 
template name even then it shows the correct web page.How? 




class RestaurantListView(ListView):
template_name='restaurants/restaurants_list.html'
def get_queryset(self):
slug=self.kwargs.get("slug")
if slug:
queryset=RestaurantLocation.objects.filter(
Q(category__iexact=slug)|
Q(category__icontains=slug)
)
else:
queryset=RestaurantLocation.objects.all()
return queryset 

##########################################################

class RestaurantListView(ListView):
def get_queryset(self):
return RestaurantLocation.objects.all(owner=self.request.user)




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c29ef43a-ff1e-4008-a2c9-099bf226d5df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to