sql to query set

2024/7/7 7:03:58

I have 2 tables:

puzz_meeting_candidats :- id, canceled, candidat_id, meeting_id
puzz_meeting :- id, Client

I have a query follow:

SELECT U1.`candidat_id` AS Col1 FROM `puzz_meeting_candidats` U1 
INNER JOIN `puzz_meeting` U2 ON ( U1.`meeting_id` = U2.`id` ) 
WHERE U2.`Client` LIKE '%ipsos%' AND U1.`canceled` = False

How to convert query above to queryset

Answer

Puzz_Meeting_Candidats.objects.filter(canceled=False, meeting__Client__contains='ipsos')

https://en.xdnf.cn/q/120253.html

Related Q&A

Google App Engine, best practice to schedule code execution [closed]

Closed. This question is opinion-based. It is not currently accepting answers.Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.Clo…

delete rows by date and add file name column for multiple csv

I have multiple "," delimited csv files with recorded water pipe pressure sensor data, already sorted by date older-newer. For all original files, the first column always contains dates forma…

X = Y = Lists vs Numbers [duplicate]

This question already has answers here:Immutable vs Mutable types(20 answers)How do I clone a list so that it doesnt change unexpectedly after assignment?(24 answers)Closed 4 years ago.In python : I h…

Python data text file grades program

Looking for help with my program. There is a text file with 5 first and last names and a number grade corresponding to each person. The task is to create a user name and change the number grade to a le…

how to fill NA with mean only for 2 or less consequective values of NA

I am new to python. please help me how I should proceed. The following dataframe contains large blocks of NaNs. # Fill the NAs with mean only for 2 or less consecutive values of NAs. # Refer to the d…

Build a new dictionary from the keys of one dictionary and the values of another dictionary

I have two dictionaries:dict_1 = ({a:1, b:2,c:3}) dict_2 = ({x:4,y:5,z:6})I want to take the keys from dict_1 and values from dict_2 and make a new dict_3dict_3 = ({a:4,b:5,c:6})

Python 2.7 - clean syntax for lvalue modification

It is very common to have struct-like types that are not expected to be modified by distant copyholders.A string is a basic example, but thats an easy case because its excusably immutable -- Python is …

Python - Global name date is not defined [closed]

Closed. This question needs debugging details. It is not currently accepting answers.Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to repro…

Python update user input with tkinter button

Im just starting with python and im having a problem. Ive tried various solutions, but i cant update the field that says 19. When i click on plus, i want it to be 20, then 21,... and when i click - it …

Python Unique DF in loop [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 5…