Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- qset = (
- Q(name=searched_name) &
- Q(birthdate=searchet_birthdate) &
- ..etc
- )
- Person.objects.filter(qset)
- # BUT I DONT WANT TO ADD CERTAIN Q(..) to qset if searchet_XXX is empty string
- # like for ex. searched_name = '' then just this
- qset = (
- Q(birthdate=searchet_birthdate) &
- ..etc
- )
- Person.objects.filter(qset)
Add Comment
Please, Sign In to add comment