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
>
>
>
> *views.py:*
>
> class DeveloperTicketView(TemplateView):
> template_name = 'app/ticket_view.html'
> ticket = Ticket.objects.all()
> extra_content = {'ticket_type':ticket}
>
> def get_context_data(self, **kwargs):
> context = super().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
>
>
>
> ticket_view.html
>
> {% extends 'app/base.html' %}
>
> {% block body %}
> {% for tickets in ticket_type%}
> {% if tickets.status == "Opened" %}
> 
> 
> 
> ID
> Status
> Created
> Title
> Description
> 
> 
> 
> {% for ticket in open_tickets %}
> 
> {{ ticket.id }}
> {{ ticket.status }}
> {{ ticket.created_by }}
> {{ ticket.ticket_title }}
> {{ ticket.ticket_description }}
>  Accept
> 
> {% endfor %}
> 
> {% elif tickets.status == 'Accepted' %}
> 
> 
> 
> ID
> Status
> Created by
> Title
> Description
> 
> 
>
> 
> {% for ticket in accepted_tickets %}
> 
> {{ ticket.id }}
> {{ ticket.status }}
> {{ ticket.created_by }}
> {{ ticket.ticket_title }}
> {{ ticket.ticket_description }}
> Complete
> 
> {% endfor %}
> 
>
> {% elif tickets.status == 'Completed' %}
>
> 
>
> 
> 
> ID
> Status
> Created by
> Title
> Description
> 
> 
>
> 
> {% for ticket in completed_tickets %}
> 
> {{ ticket.id }}
> {{ ticket.status }}
> {{ ticket.created_by }}
> {{ ticket.ticket_title }}
> {{ ticket.ticket_description }}
> 
> {% endfor %}
> {% else %}
> 
> 
> 
> ID
> Status
> Created by
> Title
> Description
> 
> 
>
> 
> {% for ticket in closed_tickets %}
> 
> {{ ticket.id }}
> {{ ticket.status }}
> {{ ticket.created_by }}
> {{ ticket.ticket_title }}
> {{ ticket.ticket_description }}
> 
> {% endfor %}
> {% endif %}
> {% endfor %}
> {% endblock %}
>
>
>
>
> On Monday, 22 November 2021 at 13:22:47 UTC+5:30 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_name based on the request.
>>
>> Or maybe you prefer a single template to deal with all cases with
>> conditional blocks where appropriate.
>>
>>
>> Regards,
>> David
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/786fa7af-0a81-4cf7-9a2e-c2fd2e9f0323n%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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOGms2_ZR_rrHuANSVAAA0Ca5ow9HVzLHQDVBf%3Dz2XjBEGTmYg%40mail.gmail.com.


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_name based on the request.
>
> Or maybe you prefer a single template to deal with all cases with
> conditional blocks where appropriate.
>
>
> Regards,
> David
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAE5VhgUCCnmkm%2BBe0EWLK4Nb%3DXUOHZAEYGax%2B2%2B-kCysYxdzHA%40mail.gmail.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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOGms2_2O%3DqKRqKTPcy7GNUeWEJu-tuJPfHwr93KVr91sAYHOA%40mail.gmail.com.


Re: Get data from table rows and save in database

2021-12-04 Thread ram s
use name attribute in site input tag...

On Sat, Dec 4, 2021 at 3:47 PM Eugene TUYIZERE 
wrote:

> Dear Colleagues,
>
> I have data in the table. I want to get the rows value and save them in
> the database. How can I do this with jquery?
> The table I have is like this
> [image: image.png]
> This is what I have in HTML. The total is automatically calculated as I
> type the amount
>
> 
>  Description 
> Amount
> 
> 
> School Fess 
> 
> 
> 
> Restoration 
> 
> 
> 
> School materials 
> 
> 
>
> 
> TOTAL 
> 
> 
> 
> --
> *Eugene*
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABxpZHsPPHbpkNOBDxGofAX-0uHPfGtgXYpHwoQo5iaqGOg9rg%40mail.gmail.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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOGms29f25MTg3j4htoaJryt3GxpyneW6mUS4J%3Dww-hDRFR2Qg%40mail.gmail.com.


Re: could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?

2021-12-10 Thread ram s
when u getting this issue while deploying on pythonanywhere.com or in your
localserver

On Mon, Dec 6, 2021 at 8:06 PM CHANDNI SINGH 
wrote:

> hey,
> i am facing the same problem
> can you please guide me on how to solve that issue ???
>
> On Thursday, 16 May, 2019 at 6:38:01 pm UTC+5:30 randmw...@gmail.com
> wrote:
>
>> First, you should not share your password to your server to anyone….thats
>> very dangerous.  Now anyone can log in to your server with nefarious
>> intentions.
>> Be more careful.
>>
>> But it sounds like something on the server is blocking your connection.
>>
>> On May 16, 2019, at 8:57 AM, omar ahmed  wrote:
>>
>> hii ..
>> i try to publish my first project on python anywhere but it still not
>> working and this is my error :
>> could not connect to server: Connection refused Is the server running on
>> host "localhost" (::1) and accepting TCP/IP connections on port 5432? could
>> not connect to server: Connection refused Is the server running on host
>> "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
>> could not connect to server: Connection refused Is the server running on
>> host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
>> and this is my db settings  :
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
>> 'NAME': 'arena',
>> 'USER': 'arenadbuser',
>> 'PASSWORD': 'mlo9**@la',
>> 'HOST': 'localhost',
>> 'PORT': '',
>> }
>> }
>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to django...@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/93204eb8-f5e3-43bf-98ff-b79478bce544%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7b66cbaf-e069-48db-ae46-8fea37c3644an%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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOGms28UZK4eN0qZT7%3DqPu%2Bur2W5JbL%3DLQvepsrOo7mkL4kvGw%40mail.gmail.com.