quokkaproject / quokka

LOOKING FOR NEW MAINTAINER - Quokka is a Content Management System - `docker run --rm -it -p 5000:5000 quokka/quokka`
http://www.quokkaproject.org
Other
2.24k stars 447 forks source link

admin: search #638

Open rochacbruno opened 6 years ago

rochacbruno commented 6 years ago

Add search to pymongo/tinymongo in admin https://github.com/rochacbruno/quokka_ng/issues/33

BenTHR commented 6 years ago

Hi @rochacbruno I'm new here in Github, and I want to help with implementation of this feature, can you please calarify more how can I contribute?

rochacbruno commented 6 years ago

Hi @BenTHR

In Quokka we have this Flask-Admin Model View https://github.com/rochacbruno/quokka/blob/master/quokka/admin/views.py#L49

If you run the project you will see that in admin we have no search form, because it is disabled and must be enabled here: https://github.com/rochacbruno/quokka/blob/master/quokka/core/content/admin.py#L14

by adding

column_searchable_list = ['title', 'author', 'tags', 'category']
column_filters = ['published']

with the above change the Search form will show, but the problem is that it does not work with tinymongo and has some problems with pymongo

So we need to override the methods init_search on https://github.com/rochacbruno/quokka/blob/master/quokka/admin/views.py#L49 and make the needed changes to make it to work.

Another issue is that some of the pymongo features are still missing in tinymongo as you can see in: https://github.com/schapman1974/tinymongo/issues/42 (looks like support has been added but needs testing)

So this issue may require some pR to be sent to Tinymongo.

Any progress we make to add search to admin will be good!