Re: SQL query to django

2021-10-10 Thread Eugene TUYIZERE
eted in each year. >> And at the end to display this on bar chart. but What I most want is the >> query. >> >> I want to transform this SQL query in Django: >> >> SELECT status from YY group by time_frame; >> >> please assist >> >> -

Re: SQL query to django

2021-10-10 Thread Sebastian Jung
ame is in terms of years and status are Not started, In progress > and Completed. I want to display all services Not started, in progress and > completed in each year. > And at the end to display this on bar chart. but What I most want is the > query. > > I want to transform thi

Re: SQL query to django

2021-10-09 Thread carlos
d to display this on bar chart. but What I most want is the > query. > > I want to transform this SQL query in Django: > > SELECT status from YY group by time_frame; > > please assist > > -- > *TUYIZERE Eugene* > > > -- > You received this message beca

SQL query to django

2021-10-09 Thread Eugene TUYIZERE
this on bar chart. but What I most want is the query. I want to transform this SQL query in Django: SELECT status from YY group by time_frame; please assist -- *TUYIZERE Eugene* -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Front end solution to run SQL query in django

2020-02-08 Thread oliseh obiajuru
I am trying to create a query builder, I have seen SQL explore which is a package but I can't bring it to the front end of my app. I need help please -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: How express SQL query using Django ORM?

2018-10-17 Thread Artem Malyshev
Hi, thanks for the reply! This gives me following query: SELECT "example_price"."category_id", "example_price"."cost" FROM "example_price" GROUP BY "example_price"."id", "example_price"."category_id", "example_price"."from_date", "example_price"."cost",

Re: How express SQL query using Django ORM?

2018-10-17 Thread v . kiselicya0210 . work
Price.objects.annotate(_sel=Max('from_date')).filter(from_date=F('_sel')).values("category_id", "price") -- 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

How express SQL query using Django ORM?

2018-10-14 Thread Artem Malyshev
Hi, I have an example application of the shop. Full application code is available at https://github.com/dry-python/tutorials/tree/master/django In this example, User can buy a subscription for different categories of the content. The user can subscribe for one day, one month or one year.

Re: Different results of running pure SQL query from Django and from PGAdmin

2018-09-12 Thread Pierre-Louis K.
Hello Bill, I managed to solve this in the end, the issue was that a cursor created in Django would enforce TIME_ZONE settings in the PostgreSQL session, where by default it is set to 'UTC' in my case. This means that all date manipulation was impacted, hence the unexpected results. The work

Re: Different results of running pure SQL query from Django and from PGAdmin

2018-09-11 Thread Bill-Torcaso-Oxfam
I'd be interested to see a printout of 'columns' and 'cursor.description'. One explanation would be that your for-loop is not actually accessing the data that you think it is, or that your query is not actually fetching the data that you think it is. No criticism of your query implied -

Re: Different results of running pure SQL query from Django and from PGAdmin

2018-09-10 Thread pierre-louis . kabaradjian
Here is the body of the code that runs the query and fetch results: with connection.cursor() as cursor: sql = ( ... ) cursor.execute(sql, [params...]) columns = [col[0] for col in cursor.description] for row in cursor.fetchall(): print(row) The results from

Re: Different results of running pure SQL query from Django and from PGAdmin

2018-09-08 Thread Jason
Hard to say what's happening without any code. -- 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

Different results of running pure SQL query from Django and from PGAdmin

2018-09-07 Thread Pierre-Louis K.
Hello django-users, I have been encountering a strange behaviour when trying to run SQL directly with a cursor. I am using Django 1.11 with porstgres 9.5.The query normally returns 7 rows with 2 columns. Symptoms: - When reading the queryset of a query I get wrong results -> I still have 7

Re: Fwd: python sql query in django

2009-02-26 Thread Jesse
Thank you for all the suggestions! Solution 1 - Did not work: pub4=Publication.objects.filter (techpubcombo__technology=t).filter(pathpubcombo__pathology=p).filter (commpubcombo__commodity=c) Solution 1 didn't pull any records Solution 2 - Did not work:

Re: Fwd: python sql query in django

2009-02-25 Thread Parthan SR
On Thu, Feb 26, 2009 at 2:24 AM, Jesse wrote: > > I have three statements: > publications = Publication.objects.filter(techpubcombo__technology=t) > publications2 = Publication.objects.filter(pathpubcombo__pathology=p) > publications3 =

Re: Fwd: python sql query in django

2009-02-25 Thread Briel
You have two choices. Either you can add .exclude() using the __in to avoid get the duplicates in the first place. Or you could iterate over the 3 pubs and append them to a list with an if statement. Something like this: list = [] for pub in publications123: If pub not in list:

Re: Fwd: python sql query in django

2009-02-25 Thread Jesse
> I believe this would work: > > publications = Publication.objects.filter(techpubcombo__technology=t) > > Regards, > > -- > Christian Joergensenhttp://www.technobabble.dk Hello Christian, Thank you so much for your answer. I have been struggling with the users group to get that syntax (I must

Re: Fwd: python sql query in django

2009-02-23 Thread Christian Joergensen
James Matthews wrote: > I have three tables: > > class Technology(models.Model): >technology = models.CharField(max_length=100, null=True, > blank=True ) >def __unicode__(self): >return self.technology >class Meta: >ordering = ["technology"] > > class

Fwd: python sql query in django

2009-02-23 Thread James Matthews
-- Forwarded message -- From: May <adles...@gmail.com> Date: Mon, Feb 23, 2009 at 9:17 PM Subject: python sql query in django To: python-l...@python.org I have three tables: class Technology(models.Model): technology = models.CharField(max_length=100, null=True, blan

Re: Problem when using RAW SQL Query with Django (not all arguments converted during string formatting)

2009-01-08 Thread Kedare
Thank you, that work fine ! On 9 jan, 05:59, "Karen Tracey" wrote: > On Thu, Jan 8, 2009 at 11:41 PM, Kedare wrote: > > > Hi, i have made a Cache management Page for Django, but i have a > > problem, i need to expire single cache entries, so i made this

Re: Problem when using RAW SQL Query with Django (not all arguments converted during string formatting)

2009-01-08 Thread Karen Tracey
On Thu, Jan 8, 2009 at 11:41 PM, Kedare wrote: > > Hi, i have made a Cache management Page for Django, but i have a > problem, i need to expire single cache entries, so i made this : > > (the url is like that by example: "/admin/cache_management/? > >

Problem when using RAW SQL Query with Django (not all arguments converted during string formatting)

2009-01-08 Thread Kedare
Hi, i have made a Cache management Page for Django, but i have a problem, i need to expire single cache entries, so i made this : (the url is like that by example: "/admin/cache_management/? action=clear=views.decorators.cache.cache_page../.d41d8cd98f00b204e9800998ecf8427e") if