u = User.objects.all() u is not a user. On Tue, Jul 17, 2012 at 2:00 PM, Sandeep kaur <mkaurkha...@gmail.com> wrote:
> I want to have different views for my application for different types > of users. For this I have this code for my views.py file : > > def index1(request): > u = User.objects.all() > if u.is_staff ==1 and u.is_active == 1 and u.is_superuser == 1: > return render_to_response('tcc11_12/index1.html', > context_instance=RequestContext(request)) > elif u.is_staff == 1 and u.is_active == 1 and u.is_superuser == 0: > return render_to_response('tcc11_12/index2.html', > context_instance=RequestContext(request)) > else: > return render_to_response('index3.html', > context_instance=RequestContext(request)) > > But it gives TypeError as : > "cannot convert dictionary update sequence element #0 to a sequence" > > Is there anything wrong in above code? > > -- > Sandeep Kaur > E-Mail: mkaurkha...@gmail.com > Blog: sandymadaan.wordpress.com > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.