Is there a way to inspect a queryset and get info about which filters/exclude have been applied?
I need it for debugging: I cannot understand why my queryset excludes some data…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That doesn’t seem easy to do. Each filter is applied differently to the query object so you’re not going to find a cleanly laid out
"filter1", "filter2", "filter3".Check out
myqueryset.query.__dict__– the incoming filter is separated into relevant areas immediately and no record stored. Details indjango.db.models.sql.query.Query.I’d check out the SQL instead.