Re: Multiple Templates in single list view

2021-11-24 Thread Lalit Suthar
I have gone through your views and template. They are looking fine to me. Are you getting any error? On Wed, 24 Nov 2021 at 23:02, Lalit Suthar wrote: > > Anyone plz review my code i am struggling to figure out what the issue > here is > > What is the issue you are trying to resolve right now? >

Re: Multiple Templates in single list view

2021-11-24 Thread Lalit Suthar
> Anyone plz review my code i am struggling to figure out what the issue here is What is the issue you are trying to resolve right now? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Re: Multiple Templates in single list view

2021-11-22 Thread Trippy Samurai
Its done bro model is configured already i didn't just posted the models.py file On Monday, 22 November 2021 at 21:18:12 UTC+5:30 ram.asf...@gmail.com wrote: > will update asap > > On Mon, Nov 22, 2021 at 1:22 PM David Nugent wrote: > >> Well, there are several ways you can deal with that. >> >

Re: Multiple Templates in single list view

2021-11-22 Thread ram s
i think u forgot to configure model, please once configure and complete check first On Mon, Nov 22, 2021 at 4:36 PM Trippy Samurai wrote: > Thanks David for the idea i appreciate it i have gone with last way of > doing things but it doesnt render anything on data > > Pls correct my code below >

Re: Multiple Templates in single list view

2021-11-22 Thread ram s
will update asap On Mon, Nov 22, 2021 at 1:22 PM David Nugent wrote: > Well, there are several ways you can deal with that. > > Probably easiest is to override get_template() and switch the template > based on whatever type of ticket you're managing or you can change the > value of self.template

Re: Multiple Templates in single list view

2021-11-22 Thread Trippy Samurai
Anyone plz review my code i am struggling to figure out what the issue here is On Monday, 22 November 2021 at 16:35:32 UTC+5:30 Trippy Samurai wrote: > Thanks David for the idea i appreciate it i have gone with last way of > doing things but it doesnt render anything on data > > Pls correct my

Re: Multiple Templates in single list view

2021-11-22 Thread Trippy Samurai
Thanks David for the idea i appreciate it i have gone with last way of doing things but it doesnt render anything on data Pls correct my code below *views.py:* class DeveloperTicketView(TemplateView): template_name = 'app/ticket_view.html' ticket = Ticket.objects.all() extra_content = {'tick

Re: Multiple Templates in single list view

2021-11-21 Thread David Nugent
Well, there are several ways you can deal with that. Probably easiest is to override get_template() and switch the template based on whatever type of ticket you're managing or you can change the value of self.template_name based on the request. Or maybe you prefer a single template to deal with a

Re: Multiple Templates in single list view

2021-11-21 Thread Trippy Samurai
What about the templates i have three different templates for as u can see in template_name in the above views ,how do i deal with it if i actualyl had one template the above could have worked. On Monday, 22 November 2021 at 12:42:59 UTC+5:30 sutharl...@gmail.com wrote: > we can go like > > ```

Re: Multiple Templates in single list view

2021-11-21 Thread David Nugent
Hi Lalit, On Mon, Nov 22, 2021 at 6:12 PM Lalit Suthar wrote: > we can go like > > ``` > > class Manager(...): > def get_context_data(self, **kwargs): > context = super() > context["open_tickets"] = Ticket.objects.filter(status="OPEN") > context["accepted_tickets"] = Ticket.objects.filter(s

Re: Multiple Templates in single list view

2021-11-21 Thread Lalit Suthar
we can go like ``` class Manager(...): def get_context_data(self, **kwargs): context = super() context["open_tickets"] = Ticket.objects.filter(status="OPEN") context["accepted_tickets"] = Ticket.objects.filter(status="ACCEPTED") context["completed_tickets"] = Ticket.objects.filter(status="CO

Re: Multiple Templates in single list view

2021-11-21 Thread Trippy Samurai
Hi Elena Thanks for the reply i have three different html pages to display open tickets closed tickets accepted tickets etc each of them have different ticket statuses i have them written in different views as above to display each type of ticket at different pages how can i combine all three i

Re: Multiple Templates in single list view

2021-11-21 Thread Elena Williams
Hi, The problem is it's unclear what your question is. Can you be clearer about what outcome you're trying to achieve? --- Elena Williams Github: elena On Mon, 22 Nov 2021 at 15:20, Trippy Samurai wrote: > Any one plz > > > On Sunday, 21 November 2021 at 15:09:39 U

Re: Multiple Templates in single list view

2021-11-21 Thread Trippy Samurai
Any one plz On Sunday, 21 November 2021 at 15:09:39 UTC+5:30 Trippy Samurai wrote: > Hello, > I have different views for displaying different templates how do i write > them into one single Listview so that i can take care of DRY > > > [image: Screenshot 2021-11-21 at 3.08.58 PM.png] > -- You