How can I use the pool and the "not" in the request for Django. I searched for him, but I can not find any examples
SELECT id,address FROM tbl_nt WHERE st_id IN (1,2) AND name = 'foo' UNION ( SELECT d.id,d.addrses FROM tbl_nt_123 d WHERE d.name='foo' AND condition_id NOT IN ( SELECT condition_id FROM tbl_conditions WHERE version_id = 5 ) )
I tried this query to the bottom, but it did not work
tbl_nt_123.objects.values_list('id', 'address').exclude( condition_id=tbl_conditions ).objects.filter(version_id=5).values_list( 'condition_id', flat=True) ) '). exclude ( tbl_nt_123.objects.values_list('id', 'address').exclude( condition_id=tbl_conditions ).objects.filter(version_id=5).values_list( 'condition_id', flat=True) )
How can i do this?
Please email me some good links or books to understand Django's preliminary requests.
thanks
source share