Surely it has self.request.GET and not self.request.get
On 23 Nov 2021, 09:11 +0300, Trippy Samurai <[email protected]>, 
wrote:
> Getting error while working with template view
>
> views.py
>
>
> class DeveloperTicketView(TemplateView):
>
> def get_template_names(self):
> if self.request.get('status') == 'Opened':
> template_name = 'app/open_tickets.html'
> elif self.request.get('status') == 'Accepted':
> template_name = 'app/dev_accepted_tickets'
> elif self.request.get('status') == "Completed":
> template_name = 'app/dev_completed_tickets.html'
> else:
> template_name = 'app/dev_closed_tickets.html'
>
> return template_name
>
>
> def get_context_data(self, **kwargs):
> context = super(DeveloperTicketView,self).get_context_data(**kwargs)
> context['open_tickets'] = Ticket.objects.filter(status = 'Opened')
> context['accepted_tickets'] = Ticket.objects.filter(status = 
> 'Accepted',accepted_by = self.request.user)
> context['completed_tickets'] = Ticket.objects.filter(status = 
> 'Completed',accepted_by = self.request.user)
> context['closed_tickets'] = Ticket.objects.filter(status = 
> 'Closed',accepted_by = self.request.user)
> return context
>  --
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/65cd3d84-5946-43d6-8abc-c78e4246fb07n%40googlegroups.com.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4e8ffafc-5b78-42fb-9458-3ee0b0c97c3c%40Spark.

Reply via email to