Hello,

Please I need help with django.db.models.Q. I have the query below which is
returning empty

qs =
Q(financial_institution=request.user.get_profile().financial_institution)
txn = Transaction.objects.extra(
                where=['(tpin=%s or teller_no=%s or identifier=%s) AND
financial_institution_id=%s'],
                params=[value, str(value), value, str(qs)])

If I substitute the line params=[value, str(value), value, str(qs)]) with
params=[value, str(value), value, 1),
I get real results from the database, meaning the problem lies with Q.

I tried to filter qs like this: txn = Transaction.objects.filter(qs), but I
got some errors that Q cannot be
filtered.

Any help will be much appreciated.

Thanks

-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to