Generic Search for any Django Model

41 views
Skip to first unread message

guettli

unread,
Jun 2, 2017, 10:10:15 AM6/2/17
to Django users
There are several libraries which enable you to do fancy pagination of django queryset.

See this grid: https://djangopackages.org/grids/g/pagination/

I have not look at all libraries, but the one I saw needed a queryset as input.

I search a solution for the step before this:

How to get to the queryset?

I search a library which translates request.GET to a queryset filter.


Example: You want to show a search form for users (model User) with a generic interface.

AFAIK this could be solved without coding, just configuring should be enough.

    http:///mydjangopage.example.com/query?username=foo&date_joined__gt=2017-01-01

The library should take request.GET and the django.contrib.auth.models.User model. The result should be a queryset. The nice double underscore feature for filter should be supported, too.

This queryset can be passed to one of above pagination libraries.

Of course authorization needs to handled somehow (but later)


License: Only open source software can be used here.

Please ask, if you don't understand the question.

I ask here, since no expert could help me here: https://softwarerecs.stackexchange.com/questions/42458/generic-search-for-any-django-model

Regards,
  Thomas Güttler

Melvyn Sopacua

unread,
Jun 2, 2017, 10:19:10 AM6/2/17
to django...@googlegroups.com

On Friday 02 June 2017 07:10:15 guettli wrote:

> There are several libraries which enable you to do fancy pagination of

> django queryset.

>

> See this grid: https://djangopackages.org/grids/g/pagination/

 

And try looking at this grid:

https://djangopackages.org/grids/g/filters/

 

 

--

Melvyn Sopacua

guettli

unread,
Jun 6, 2017, 11:25:58 AM6/6/17
to Django users
Thank you Melvyn Sopacua, I was blind :-)
Reply all
Reply to author
Forward
0 new messages