Re: ORM Bug from extending the `Query` class

2024-10-16 Thread Sam Brown
age of `Query` to fix the bug? Below is the > contents of the ticket, including a reproduction. > > Thanks, > Ben Pearman > > ___ > > We have observed a bug in the ORM where invalid SQL can be produced. > > A reproduction can be seen here: > ​https://github.com/benpearman/dj

ORM Bug from extending the `Query` class

2024-10-15 Thread Ben Pearman
` to fix the bug? Below is the contents of the ticket, including a reproduction. Thanks, Ben Pearman ___ We have observed a bug in the ORM where invalid SQL can be produced. A reproduction can be seen here: ​https://github.com/benpearman/django-orm-bug <https://github.com/benpearman/django-

Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-27 Thread Krishnakant Mane
wrote: Im sure there are performance metrics out there to prove the ORM will not be the bottleneck. But I’ve never seen it slow things down when I’ve employed a timer on operation Also, ive recently ran into some of the limitations of drf and am looking into moving to an api that can be less

Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-14 Thread ReynardSec
Hello, On Sunday 14 July 2024 at 09:03:38 UTC+2 eric paul wrote: In whatever way possible use the Django ORM for security purposes and also efficiency . Offtopic: There are certain issues worth keeping in mind, even if you are using an ORM: https://www.elttam.com/blog/plormbing-your-django

Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-14 Thread eric paul
t; > I have already mentioned my scenario and given the case study which I am > working on. > > In that reference, how using the ORM will benefit more than raw queries > working with materialised views? > > Regarding security, I (and the team working on this ) are totally aware of &g

Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-14 Thread Singhal._.paras
Bro , Just go for it ! On Sun, 14 Jul, 2024, 22:58 Krishnakant Mane, wrote: > I am looking into ninja too. > > I guess I may be able to use SQLAlchemy seamlessly with it. > > Regards. > On 7/14/24 21:35, Sam Brown wrote: > > Im sure there are performance metrics out the

Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-14 Thread Krishnakant Mane
I am looking into ninja too. I guess I may be able to use SQLAlchemy seamlessly with it. Regards. On 7/14/24 21:35, Sam Brown wrote: Im sure there are performance metrics out there to prove the ORM will not be the bottleneck. But I’ve never seen it slow things down when I’ve employed a timer

Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-14 Thread Gulshan Yadav
If you use ORM QUERY THEN IT IS VERY EASY TO SOLVE THIS ONE BY USING FOREIGN KEY OR MANY TO MANY RELATIONSHIP AND WHEN IF USER NOT RAGISTER THEN WE NEED TO ADD NON RAGISTER USER UNIQUE KEY FOR IDENTIFICATION AND AMOUNT WHICH ONE TAKE RECIEVE THE MONEY STORED IDENTIFICATION KEY IN PAYMENT TABLE

Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-14 Thread Sam Brown
Im sure there are performance metrics out there to prove the ORM will not be the bottleneck. But I’ve never seen it slow things down when I’ve employed a timer on operation Also, ive recently ran into some of the limitations of drf and am looking into moving to an api that can be less coupled

Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-14 Thread eric paul
In whatever way possible use the Django ORM for security purposes and also efficiency . I won't recommend to use Raw queries if you don't know what you are doing On Sun, Jul 14, 2024, 7:34 AM Enock Deghost wrote: > 🙄 > > On Sun, 14 Jul 2024, 6:15 am Krishnakant Mane,

Re: Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-13 Thread Enock Deghost
🙄 On Sun, 14 Jul 2024, 6:15 am Krishnakant Mane, wrote: > Hello. > > I am seasoned SQLAlchemy user and quite good in node's sequelise ORM. > > But I am new to the one with Django.So here's my situation. > > I am developing an accounting (book keeping ) automation

Help deciding ORM VS raw SQL trade-off in Complex scenario

2024-07-13 Thread Krishnakant Mane
Hello. I am seasoned SQLAlchemy user and quite good in node's sequelise ORM. But I am new to the one with Django.So here's my situation. I am developing an accounting (book keeping ) automation software service. So there are accounting rules (Debit = Dr and credit = Cr) for double

Re: Django ORM: move filter after annotate subquery

2023-04-28 Thread Aivan Fouren
_created').desc()] ) ) \ .filter(ord=1) result = Model.objects.all() \ .filter(id__in=sub.values_list('id')) \ .filter(date_created__lte=some_datetime) However, this is not a code I want, it's bad from performance point of view due to HASH JOIN. Of course, I can write a raw SQL quer

Django ORM: move filter after annotate subquery

2023-04-28 Thread Aivan Fouren
This Django ORM statement: Model.objects.all() \ .annotate( ord=Window( expression=RowNumber(), partition_by=F('related_id'), order_by=[F("date_created").desc()] ) \ .filter(ord=1) \ .filter(date_created__lte=some_datetime) Leads to the followi

Fwd: How to create orm query if data is exist or not ?

2023-02-23 Thread Prashanth Patelc
-- Forwarded message - From: Prashanth Patelc Date: Thu, Feb 23, 2023 at 5:11 PM Subject: How to create orm query if data is exist or not ? To: Hi all, How to create orm query with data exist or not ? How to check if approval_status Pending and Rejected with same user

How to create orm query if data is exist or not ?

2023-02-23 Thread Prashanth Patelc
Hi all, How to create orm query with data exist or not ? How to check if approval_status Pending and Rejected with same user contains from_date approval_status User 2023-01-20 - ApprovedNewUser 2023-01-12 - Rejected NewUser 2023-01

Custom Django ORM manager

2023-02-20 Thread Zdravko Georev
Hi all, What is the point for creating custom, our own, ORM manager? Maybe I ask this dumb question because I lack of experience at all :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Orm query

2023-02-17 Thread Prashanth Patelc
Hi all, This is my model if model contain previous month dates I need to and store the data If user is new previous data is not available I need to store directly to db . How to write orm query? Attendance.object.filter(user=emp,date=enddate,crea_date=strdate) If dates is not available in

Re: Combining two subquery counts using ORM

2022-11-09 Thread Ross Meredith
day, 9 November 2022 at 20:46:15 UTC julika...@gmail.com wrote: > >> Post your model here and we do it >> >> On Wed, Nov 9, 2022, 7:37 PM Matthew Hegarty wrote: >> >>> My question is about translating a SQL query to the ORM. >>> >>> I want to comb

Re: Combining two subquery counts using ORM

2022-11-09 Thread Matthew Hegarty
Post your model here and we do it > > On Wed, Nov 9, 2022, 7:37 PM Matthew Hegarty wrote: > >> My question is about translating a SQL query to the ORM. >> >> I want to combine the output of two queries into one. The query is >> counting records in the same table

Re: Combining two subquery counts using ORM

2022-11-09 Thread kateregga julius
Post your model here and we do it On Wed, Nov 9, 2022, 7:37 PM Matthew Hegarty wrote: > My question is about translating a SQL query to the ORM. > > I want to combine the output of two queries into one. The query is > counting records in the same table (Task) using two diff

Combining two subquery counts using ORM

2022-11-09 Thread Matthew Hegarty
My question is about translating a SQL query to the ORM. I want to combine the output of two queries into one. The query is counting records in the same table (Task) using two different fields. The query is: select q1.taskname, q1.count, q2.count, (q1.count + q2.count) as total from ( select

Re: Averaging timestamp deltas with Django ORM

2022-09-15 Thread Joshua Corlin
ve a seemingly simple task I am trying to achieve with one of my > projects. Looking to see if the following is possible, and if so what the > syntax would be with the Django ORM. Apologies in advance if this is a > trivial one. > > I have a requests model that has a bunch of ti

Re: Averaging timestamp deltas with Django ORM

2022-09-08 Thread Toshar Saini
rrectly. > > I have a seemingly simple task I am trying to achieve with one of my > projects. Looking to see if the following is possible, and if so what the > syntax would be with the Django ORM. Apologies in advance if this is a > trivial one. > > I have a requests model tha

Re: Averaging timestamp deltas with Django ORM

2022-09-07 Thread Thomas Lockhart
projects. Looking to see if the following is possible, and if so what the > syntax would be with the Django ORM. Apologies in advance if this is a > trivial one. > > I have a requests model that has a bunch of time stamps(6 to be specific) and > these timestamps record milestones in t

Averaging timestamp deltas with Django ORM

2022-09-07 Thread Joshua Corlin
ORM. Apologies in advance if this is a trivial one. I have a requests model that has a bunch of time stamps(6 to be specific) and these timestamps record milestones in the request, set throughout the lifecycle of a request. Im trying to write a query that gets a set of records, calculates the

Re: Help to implement join query in django orm

2022-07-25 Thread 'Amitesh Sahay' via Django users
10. How to perform join operations in django ORM? — Django ORM Cookbook 2.0 documentation (agiliq.com) Try this On Monday, 25 July, 2022 at 01:18:44 pm IST, Mihir Patel wrote: is anyone having login issue? , i am unable to authenticate a user in my website On Sun, Jul 24, 2022 at

Re: Help to implement join query in django orm

2022-07-25 Thread Mihir Patel
is anyone having login issue? , i am unable to authenticate a user in my website On Sun, Jul 24, 2022 at 10:37 PM Jitendra kumar Patra < jitendrapatra...@gmail.com> wrote: > Ping me 7008080545 > > On Fri, 22 Jul, 2022, 12:16 Avi shah, wrote: > >> I have two tables >> Tbl 1 >> & >> Tbl 2 >> >> I

Re: Help to implement join query in django orm

2022-07-24 Thread Jitendra kumar Patra
Ping me 7008080545 On Fri, 22 Jul, 2022, 12:16 Avi shah, wrote: > I have two tables > Tbl 1 > & > Tbl 2 > > I need to connect the two tables using a join > > > Thanks and regards, > Avi shah > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group

Re: Help to implement join query in django orm

2022-07-24 Thread Abhishek Gupta
Hey, you have to write custom raw query for join tables which are not connected with foreign key relationship in django. On Sun, Jul 24, 2022, 11:17 Lalit Suthar wrote: > this can be helpful > > https://betterprogramming.pub/django-select-related-and-prefetch-related-f23043fd635d > > On Sun, 24

Re: Help to implement join query in django orm

2022-07-23 Thread Lalit Suthar
this can be helpful https://betterprogramming.pub/django-select-related-and-prefetch-related-f23043fd635d On Sun, 24 Jul 2022 at 00:30, Ryan Nowakowski wrote: > On Fri, Jul 22, 2022 at 12:16:14PM +0530, Avi shah wrote: > > I have two tables > > Tbl 1 > > & > > Tbl 2 > > > > I need to connect the

Re: Help to implement join query in django orm

2022-07-23 Thread Ryan Nowakowski
On Fri, Jul 22, 2022 at 12:16:14PM +0530, Avi shah wrote: > I have two tables > Tbl 1 > & > Tbl 2 > > I need to connect the two tables using a join If these tables were created outside of Django, in other words, not using manage.py migrate, you can use Django's legacy database support to auto gen

Help to implement join query in django orm

2022-07-21 Thread Avi shah
I have two tables Tbl 1 & Tbl 2 I need to connect the two tables using a join Thanks and regards, Avi shah -- 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 dja

ORM migration index name mismatch. Can't drop existing index.

2022-05-16 Thread Konstantin Kuchkov
t;; Works correctly if I add a RunSQL migration to remove the culprit. So I'm wondering where did the other index name come from? We never mess with postgres schema without going through Django ORM. Originally, the table was created in Django 1.11, and, currently, we're on Django 4.04. Did so

Re: How to construct nested QuerySet with django ORM?

2022-05-15 Thread Jason
email, I'll just copy a > StackOverFlow link. > > > https://stackoverflow.com/questions/72251670/how-to-construct-nested-queryset-with-django-orm > > Ignoring the `DRF` part, I want to construct an `object` like this, how to > do it? > -- You received this mes

How to construct nested QuerySet with django ORM?

2022-05-15 Thread ivory 954
It's too inconvenient to paste the code in the email, I'll just copy a StackOverFlow link. https://stackoverflow.com/questions/72251670/how-to-construct-nested-queryset-with-django-orm Ignoring the `DRF` part, I want to construct an `object` like this, how to do it? -- You rec

RE: Django ORM bug(probably, not)

2022-02-07 Thread Feroz Ahmed
users Subject: Django ORM bug(probably, not) Hello, I have overloaded delete() method of my model to enable soft deletion so that delete() method just sets is_seleted field to be True. When calling this method for individual objects, it works fine. But when I called delete() method directly for

Django ORM bug(probably, not)

2022-02-07 Thread Bobosher Musurmonov
Hello, I have overloaded delete() method of my model to enable soft deletion so that delete() method just sets is_seleted field to be True. When calling this method for individual objects, it works fine. But when I called delete() method directly for a queryset (for example, MyModel.objects.filte

Re: Perform a join in 5 tables or more than that USIN ORM

2022-01-30 Thread narendra thapa
Chaffy wrote: > Yes you can > > What’s your model look like ? > > On Sun, Jan 30, 2022 at 7:26 AM narendra...@gmail.com < > narendrathapa...@gmail.com> wrote: > >> hello folks, >> any django ex[ert here, I want to know if anybody can do multiple join

Re: Perform a join in 5 tables or more than that USIN ORM

2022-01-30 Thread Sam Chaffy
Yes you can What’s your model look like ? On Sun, Jan 30, 2022 at 7:26 AM narendra...@gmail.com < narendrathapa...@gmail.com> wrote: > hello folks, > any django ex[ert here, I want to know if anybody can do multiple join > more than 5 tables at once using ORM > Prefetc

Perform a join in 5 tables or more than that USIN ORM

2022-01-30 Thread narendra...@gmail.com
hello folks, any django ex[ert here, I want to know if anybody can do multiple join more than 5 tables at once using ORM Prefetch,prefetch_related,select_related using any of these or in a different way please ping, or just write over here how can we solve that. i didn't get any clue

Re: Using ORM to retrieve values (REAL) from SQLite database to round to 2 decimal places

2021-06-21 Thread Lalit Suthar
gt; On Fri, 18 Jun 2021 at 22:43, Wai Yeung wrote: >> >>> Hello, >>> >>> To be able to get a REAL value from a SQLite database rounded to 2 >>> decimal places, I had to use the following RAW SQL query: >>> >>> SELECT >>>

Re: Using ORM to retrieve values (REAL) from SQLite database to round to 2 decimal places

2021-06-21 Thread Wai Yeung
unded to 2 >> decimal places, I had to use the following RAW SQL query: >> >> SELECT >> printf("%.2f", round(orig_total,2)), >> FROM final_billing_tbl >> >> I would like to be able to duplicate the functionality of the in ORM to >> creat

Re: Using ORM to retrieve values (REAL) from SQLite database to round to 2 decimal places

2021-06-19 Thread Lalit Suthar
: > > SELECT > printf("%.2f", round(orig_total,2)), > FROM final_billing_tbl > > I would like to be able to duplicate the functionality of the in ORM to > create a queryset. I need the result in the queryset because later in the > procedure, I search the query

Using ORM to retrieve values (REAL) from SQLite database to round to 2 decimal places

2021-06-18 Thread Wai Yeung
Hello, To be able to get a REAL value from a SQLite database rounded to 2 decimal places, I had to use the following RAW SQL query: SELECT printf("%.2f", round(orig_total,2)), FROM final_billing_tbl I would like to be able to duplicate the functionality of the in ORM to

Re: Report like "matrix with Django ORM

2021-05-10 Thread Walter Randazzo
Hi dudes, >> >> I have to render a template with a "matrix" data, I was trying to >> perform it with querys in orm but i can´t figure out how because the >> relationships of the models. >> >> The idea is to show the members and what's month

Re: Report like "matrix with Django ORM

2021-05-10 Thread Walter Randazzo
t; >> Em domingo, 9 de maio de 2021 às 23:09:09 UTC-3, wwran...@gmail.com >> escreveu: >> >>> Hi dudes, >>> >>> I have to render a template with a "matrix" data, I was trying to >>> perform it with querys in orm but i can´t figure ou

Re: Report like "matrix with Django ORM

2021-05-10 Thread Walter Randazzo
t; data, I was trying to >> perform it with querys in orm but i can´t figure out how because the >> relationships of the models. >> >> The idea is to show the members and what's months are paid in a specific >> year. >> >> *Template's out to feed

Re: Report like "matrix with Django ORM

2021-05-10 Thread Abdelrhman Elbershawi
late with a "matrix" data, I was trying to >> perform it with querys in orm but i can´t figure out how because the >> relationships of the models. >> >> The idea is to show the members and what's months are paid in a specific >> year. >> >&

Re: Report like "matrix with Django ORM

2021-05-10 Thread Luciano Martins
coloque seu code no github... Em domingo, 9 de maio de 2021 às 23:09:09 UTC-3, wwran...@gmail.com escreveu: > Hi dudes, > > I have to render a template with a "matrix" data, I was trying to perform > it with querys in orm but i can´t figure out how because the relation

How can you 'Bake' queries in Django, does an ORM extension exist for this?

2021-04-09 Thread rol...@gmail.com
Django's ORM is pretty slow. Sometimes Django can spend more time *building the SQL* than actually fetching a singular object. SQLAlchemy has this https://docs.sqlalchemy.org/en/14/orm/extensions/baked.html Which has been moved into SQLAlchemy core. https://docs.sqlalchemy.org/en/14

How to use the PostGIS aggregate function ST_AsMVT with Django ORM

2021-02-25 Thread Stefan Brand
Hello everyone, this is a repost of https://stackoverflow.com/questions/65508291/how-to-use-the-postgis-aggregate-function-st-asmvt-with-django-orm (click for nice formatting). I'm providing the problem description below as well. Thank you, for your kind consideration! Best, S

Pg Full Text search in the ORM

2021-02-24 Thread Stats Student
Hi, does anyone know how to translate the following query to the ORM? select * from company where to_tsvector(name) @@ to_tsquery('gold:*') So far I have the following, but cannot seem to integrate the [:*] piece. Company.objects.annotate(search = SearchVector('name&#

Re: Django ORM annotate performance

2021-01-15 Thread Naresh Jonnala
Hi, print(qs.query) and share. On Wednesday, January 13, 2021 at 11:25:06 PM UTC+5:30 pawe...@gmail.com wrote: > Hi all, > > I wanted to cross post my question / problem in regards to Django's ORM > `annotate` performance. Not sure if I should post it here on or Django >

Joining two unrelated tables via the ORM with m-to-m relationship?

2020-12-14 Thread Sam Clark
olumn". However I'm curious if there's a way to accomplish this using the ORM? I found "ForeignObject" but it doesn't work in this scenario as the sheetid, line, column fields are not unique (any provider could potentially have a given sheet, line, column combination whi

Re: Replicating complex query with two dense_rank() functions using ORM

2020-11-04 Thread Simon Charette
This is unfortunately not possible to do through the ORM right now due to lack of support for filtering against window expressions[0] Until this ticket is solved you'll have to rely on raw SQL. Cheers, Simon [0] ticket https://code.djangoproject.com/ticket/28333 Le mercredi 4 novembre 2

Re: Replicating complex query with two dense_rank() functions using ORM

2020-11-04 Thread Ramon NHB
can see, it does a dens_rank > over the puzzles (to count them in order), then does a join with the > PuzzleAnswer, then does a second dense rank over the merged tables. I > figured out how to use the DenseRank function in the Django ORM on the > Puzzle manager, but I cannot figure out

Replicating complex query with two dense_rank() functions using ORM

2020-11-03 Thread Brad Buran
I figured out how to use the DenseRank function in the Django ORM on the Puzzle manager, but I cannot figure out how to do the left join next. Any advice? SELECT min(s.id) AS id, count(s.date) AS streak, min(s.date) AS start_streak, max(s.date) AS end_streak, s.author_id FRO

Re: Django ORM Model meta internal API to current API update

2020-09-08 Thread Shaheed Haque
On Tue, 8 Sep 2020 at 03:54, Asif Saif Uddin wrote: > any help? I can share the full function > I've poked around some of these dark corners, but only since the late 2.x series. After a bit of searching this find-the-field-that-connects-a-model-to-a-through-model

Re: Django ORM Model meta internal API to current API update

2020-09-07 Thread Asif Saif Uddin
any help? I can share the full function On Wednesday, August 19, 2020 at 3:42:09 AM UTC+6 vickkymb...@gmail.com wrote: > I don't bro i just started new in Django > > Victor > > On Tue, Aug 18, 2020, 3:46 PM Asif Saif Uddin wrote: > >> >> Hi, >> I have got an old project of django 1.8 which use

Re: Django ORM Model meta internal API to current API update

2020-08-18 Thread Mbah Victor
I don't bro i just started new in Django Victor On Tue, Aug 18, 2020, 3:46 PM Asif Saif Uddin wrote: > > Hi, > I have got an old project of django 1.8 which use codes like > > links = [rel.get_accessor_name() for rel in > self._meta.get_all_related_objects()] > > How would I upgrade this code s

Django ORM Model meta internal API to current API update

2020-08-18 Thread Asif Saif Uddin
Hi, I have got an old project of django 1.8 which use codes like links = [rel.get_accessor_name() for rel in self._meta.get_all_related_objects()] How would I upgrade this code snippets to django 2.2 LTS? TIA -- You received this message because you are subscribed to the Google Groups "Djan

join query to get the maximum value in django orm

2020-07-13 Thread Rajshree Some
Table1 id namecomment 1 Item1 Bad 2 Item2 Good Table2 Id table1_id marks 1. 1 23 2. 1 54 3. 2 66 4. 2

Re: Django-Firebase cloudstore ORM

2020-06-21 Thread Kidwell Nyatsambo
Does anyone know how to perfectly use Firebase with Django? >> >> I am using Django-Firebase-ORM which automatically maps my models to >> cloud firestore database but I am getting error. >> Model.py >> from firebase_orm import models >> # Create

Re: Django-Firebase cloudstore ORM

2020-06-10 Thread Integr@te System
Hi Goil, Did you register your model to site admin contrib. On Wed, Jun 10, 2020, 6:52 AM sparsh goil wrote: > Hey, > Does anyone know how to perfectly use Firebase with Django? > > I am using Django-Firebase-ORM which automatically maps my models to cloud > firestore da

Django-Firebase cloudstore ORM

2020-06-09 Thread sparsh goil
Hey, Does anyone know how to perfectly use Firebase with Django? I am using Django-Firebase-ORM which automatically maps my models to cloud firestore database but I am getting error. Model.py from firebase_orm import models # Create your models here. class Article(models.Model): headline

Re: Error in to save data in DB using Django ORM

2020-06-07 Thread wongX Ndeso
Well, can you send the error message? It's important before i answer your question On Sat, Jun 6, 2020, 11:48 PM Ganesh Prajapat wrote: > hello, > I have a problem in my project. > basically scenario is i have 3 classes in > models.py(Subject,Exam,Registration). > Subject class have 2 field(subj

Re: Error in to save data in DB using Django ORM

2020-06-06 Thread Shamgar Musobero
I am a student who developed a web based system to track where corona virus is in my country .It is intergrated with google maps.The link is https://shamgarmusobero.github.io/COVID-19/

Error in to save data in DB using Django ORM

2020-06-06 Thread Ganesh Prajapat
hello, I have a problem in my project. basically scenario is i have 3 classes in models.py(Subject,Exam,Registration). Subject class have 2 field(subject_name,subject_code,id(pk)). Exam class have 3 field(exam_name,exam_code(pk),subject_of_exam(Foreign key relation with Subject class)). Registr

Re: Good usage of native JSON functions and operators in ORM queries

2020-06-02 Thread Shaheed Haque
- Snapshot JSONs might easily be 20MB in size. >- Each 'pay_definition' is probablyonly about 1kB in size, and there >might be 50 of them in a snapshot. >- There might be 1000 MyModel instances in a given query. >- I'm using PostgreSQL 12 > > so my con

Good usage of native JSON functions and operators in ORM queries

2020-05-30 Thread Shaheed Haque
Hi, I have a model MyModel which has a JSONField() called 'snapshot'. In Python terms, each snapshot looks like this: == snapshot = { 'pay_definition' : { '1234': {..., 'name': 'foo', ...}, '99': {..., 'name': 'bar', ...}, } == I'd like

ORM

2020-04-22 Thread Jayesh Prajapati
Hello World, I have doubt for that's why I come here. If one can clear my doubt it would be so helpful. Suppose, I have a table 3 table with foreign key of in each table. Table 1 FK of table 2 Table 2 FK of table 3 Table 3 FK of another table Now, what I am doing is t1 = Table1.objects

Re: ORM from the command line

2020-04-09 Thread Tim Johnson
ot be part of a deployed website. This should not be a very complicated endeavor. The simplest method might be to manually establish an ORM connection using settings.py to import the connection credentials. I am wondering if this is possibl

Re: ORM from the command line

2020-04-09 Thread Adam Mičuda
tgres >> >> 2) truncate two tables and repopulate them based on an arbitrary data >> structure such as a compound list or tuple. >> >> Such an application would not need be and most preferably should not be >> part of a deployed website. >> >> This should no

Re: ORM from the command line

2020-04-09 Thread Tim Johnson
trary data structure such as a compound list or tuple. Such an application would not need be and most preferably should not be part of a deployed website. This should not be a very complicated endeavor. The simplest method might be to manually establish an ORM connection u

Re: ORM from the command line

2020-04-09 Thread Andréas Kühne
t; This should not be a very complicated endeavor. The simplest method > might be to manually establish an ORM connection using settings.py to > import the connection credentials. I am wondering if this is possible. > > However, I am unable to find documentation that would edify me on &g

ORM from the command line

2020-04-08 Thread Tim Johnson
rary data structure such as a compound list or tuple. Such an application would not need be and most preferably should not be part of a deployed website. This should not be a very complicated endeavor. The simplest method might be to manually establish an ORM connection using settings.py

Re: Django ORM query with joins

2020-03-30 Thread Anoop Thiparala
thanks that worked On Monday, March 30, 2020 at 7:49:07 PM UTC+5:30, Suraj Thapa FC wrote: > > Sorry its like this... > posts.objects.values('id', 'details', 'user__name' ) > > On Mon, 30 Mar 2020, 7:46 pm Suraj Thapa FC, > wrote: > >> posts.model.values('id', 'details', 'user__name' ) >> >> On

Re: Django ORM query with joins

2020-03-30 Thread Suraj Thapa FC
Sorry its like this... posts.objects.values('id', 'details', 'user__name' ) On Mon, 30 Mar 2020, 7:46 pm Suraj Thapa FC, wrote: > posts.model.values('id', 'details', 'user__name' ) > > On Mon, 30 Mar 2020, 5:26 pm Anoop Thiparala, > wrote: > >> I need help with a django query...I have two model

Re: Django ORM query with joins

2020-03-30 Thread Suraj Thapa FC
posts.model.values('id', 'details', 'user__name' ) On Mon, 30 Mar 2020, 5:26 pm Anoop Thiparala, wrote: > I need help with a django query...I have two models > > 1)* POSTS* > ==>id > ==>details > ==>user(foreign key to user table) > > 2) *USER* > ==>id > ==>email > ==>name > > *SQL VERSION:* SEL

Django ORM query with joins

2020-03-30 Thread Anoop Thiparala
I need help with a django query...I have two models 1)* POSTS* ==>id ==>details ==>user(foreign key to user table) 2) *USER* ==>id ==>email ==>name *SQL VERSION:* SELECT POSTS.ID, POSTS.DETAILS, USER.NAME FROM POSTS, USER WHERE POSTS.USER == USER.ID; I require these details in the same queryse

Re: Can you do this with the Django ORM?

2020-03-21 Thread johnf
google "django send raw sql" Johnf On 3/21/20 8:52 AM, 'rossm6' via Django users wrote: Can the django ORM do something like this? |SELECT *FROM "products_maxbid"asm JOIN "products_auction"asa on m.auction_id =a.uuid WHERE m.uuid in(SELECT m.uuid FROM

Can you do this with the Django ORM?

2020-03-21 Thread 'rossm6' via Django users
Can the django ORM do something like this? SELECT * FROM "products_maxbid" as m JOIN "products_auction" as a on m.auction_id = a.uuid WHERE m.uuid in ( SELECT m.uuid FROM "products_maxbid" as m INNER JOIN ( SELECT auction_id, Max(value)

Announcing CockroachDB support for Django ORM

2020-01-27 Thread 'Charlotte Dillon' via Django users
https://pypi.org/project/django-cockroachdb/ -- 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 o

Re: Django ORM

2020-01-17 Thread maninder singh Kumar
Suraj Thapa FC wrote: > Use select related in django orm > > On Fri, 17 Jan 2020, 7:57 pm Soumen Khatua, > wrote: > >> Hi Folks, >> *Actually I'm extending User table in some other table and this current >> table I'm extending soe other table. But this tim

Re: Django ORM

2020-01-17 Thread Suraj Thapa FC
Use select related in django orm On Fri, 17 Jan 2020, 7:57 pm Soumen Khatua, wrote: > Hi Folks, > *Actually I'm extending User table in some other table and this current > table I'm extending soe other table. But this time I want to filter by > using first table user

Django ORM

2020-01-17 Thread Soumen Khatua
Hi Folks, *Actually I'm extending User table in some other table and this current table I'm extending soe other table. But this time I want to filter by using first table username How can i Do that?* *Example:* *class FirstTable(models.Model):* *user_by = models.ForeignKey(user,related_na

Aggregating distinct across OneToMany relationships using ORM

2020-01-05 Thread 'Stephen' via Django users
to do it in the ORM query setting - any ideas? More details and class definitions, as well as raw SQL are available here: https://stackoverflow.com/questions/59478515/aggregating-of-distinct-dates-across-onetomany-relationships-using-djangos-or Many thanks in advance for any guidance! S -- Yo

Re: django orm filter queryset is returning empty

2019-12-18 Thread Dilraj sachdev
sounds like because some filters returning no results On Tuesday, 17 December 2019 11:36:29 UTC, vignesh s wrote: > > django orm filter queryset is returning empty queryset and also checked in > the db the data is available > -- You received this message because you are subsc

Re: django orm filter queryset is returning empty

2019-12-17 Thread Ahmad Ebrahim
Show me your code. On Tue, 17 Dec 2019, 14:36 vignesh s, wrote: > django orm filter queryset is returning empty queryset and also checked in > the db the data is available > > -- > You received this message because you are subscribed to the Google Groups > "Django users&q

django orm filter queryset is returning empty

2019-12-17 Thread vignesh s
django orm filter queryset is returning empty queryset and also checked in the db the data is available -- 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

Re: How to write raw SQL or ORM for Count

2019-12-12 Thread Dvs Khamele
Hi We are worlds first affordable Python, Django Based Web Developement Startup. And can help you in this and related tasks / projects immidiately mere at $7 per hour. On Mon, 2 Dec 2019 at 19:13, xiaopeng luo wrote: > I am new to django ORM, I want query something like this: > > inp

Re: orm relation

2019-12-12 Thread Dvs Khamele
.cod_encais) > where (YEAR(c.dat_enc) - c.annee > 3 ) and ((YEAR(getdate()) - > YEAR(a.dat_nais)) between 54 and 70) and c.cod_nat = 'CN' > order by a.nom_, a.prn, c.annee asc; > > hello; > my models are users, enca; encr; > who can i performe this query using dja

Re: Ayuda como pasar un sql al ORM Django

2019-12-09 Thread Integr@te System
Hi friend, https://docs.djangoproject.com/en/2.2/topics/db/queries/ On Sun, Dec 8, 2019, 04:57 DEYMER DE JESUS HOYOS PEREZ < ddhoy...@misena.edu.co> wrote: > Me gustaría saber como puedo pasar esta consulta de postgresql usando el > orm de django > > SELECT peluquer

Re: Ayuda como pasar un sql al ORM Django

2019-12-07 Thread Joalbert Palacios
en lo referente a modelos. Espero sea de ayuda. Un saludo, Joalbert On Sat, Dec 7, 2019, 6:58 PM DEYMER DE JESUS HOYOS PEREZ < ddhoy...@misena.edu.co> wrote: > Me gustaría saber como puedo pasar esta consulta de postgresql usando el > orm de django > > SELECT peluquer

Ayuda como pasar un sql al ORM Django

2019-12-07 Thread DEYMER DE JESUS HOYOS PEREZ
Me gustaría saber como puedo pasar esta consulta de postgresql usando el orm de django SELECT peluqueria_persona."Nombre", "GananciaEmpleado" From venta_venta INNER JOIN cita_cita ON cita_cita.id = "Cita_id" INNER JOIN peluqueria_empleado ON cita_cita.i

Re: orm relation

2019-12-03 Thread Integr@te System
;> ,cast([dat_deces] as date) as dat_deces >>>>> ,cast([dat_imm] as date) as dat_imm >>>>> ,cast([dat_aj] as date) as dat_j >>>>> ,[cod_position] >>>>> ,YEAR(dat_imm) as anne_imm >>>>> ,YEAR(dat_encais

Re: orm relation

2019-12-03 Thread bill dexter
ast([dat_aj] as date) as dat_j >>>> ,[cod_position] >>>> ,YEAR(dat_imm) as anne_imm >>>> ,YEAR(dat_encais) as ann_regl >>>> ,[annee] >>>> ,[cod_nat] >>>> ,cast([dat_e >>>> >>>>

Re: orm relation

2019-12-02 Thread Integr@te System
eft join encr c on (c.cod_encais = e.cod_encais) >>> where (YEAR(c.dat_enc) - c.annee > 3 ) and ((YEAR(getdate()) - >>> YEAR(a.dat_nais)) between 54 and 70) and c.cod_nat = 'CN' >>> order by a.nom_, a.prn, c.annee asc; >>> >>> hell

Re: How to write raw SQL or ORM for Count

2019-12-02 Thread Luqman Shofuleji
above you can apply similar method to get Max, Sum and others On Mon, Dec 2, 2019 at 2:43 PM xiaopeng luo wrote: > I am new to django ORM, I want query something like this: > > input: > AAAfemale1 > AAAfemale2 > BBBmale 1 > BBBmale 3 &

  1   2   3   4   5   6   7   8   9   10   >