quantumlicht / django-wine

Django version of Site vins
3 stars 1 forks source link

Search form for wines with various search types #13

Closed quantumlicht closed 10 years ago

quantumlicht commented 10 years ago

Search wine by

Basically, same search queries as in the admin

The different search type should be displayed as a dropdown next to the input field.

Search should be in the navbar

Limit the number of results per page, with the option for the user to modify this number. Define a database offset linked to the page number, to only fetch the results to populate one page. Still need to do an initial count() call to know how many pages tabs to render.

We could have a unique field were all the queries take place and we load the data with an ajax call.

In the view, we should not use directly the value that is passed to do the query. Instead, we should compare it internally to expected lookup fields. If none match, we return an empty response. This can be used by the template to display that they are no results available.

quantumlicht commented 10 years ago

Should we do the search with an ajax call ?

quantumlicht commented 10 years ago

Depends if we want to have a dedicated search page. If we have a dedicated search page, we can actually do queries with many filters. If we go with this approach, we can call the search api with ajax and update the results everytime the user changes a search field.

If we integrate the search in the navbar, we can only search with one field. We also have to redirect to a page with the results, Which could very well be the same page as the one described in the previous option where the user could continue his search with more details.