Skip to content

Instantly share code, notes, and snippets.

@BastinRobin
Created November 25, 2015 15:58
Show Gist options
  • Select an option

  • Save BastinRobin/5ab7df04a995e9c9c291 to your computer and use it in GitHub Desktop.

Select an option

Save BastinRobin/5ab7df04a995e9c9c291 to your computer and use it in GitHub Desktop.
Django Dynamic URL parameter Query
model = Model.objects
for k,vals in request.GET.lists():
for v in vals:
result = model.filter(**{"%s__in" % k: vals})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment