biodiv / anycluster

Server-side clustering of map markers for (Geo)Django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change separator in parseFilters method

vetal4444 opened this issue · comments

What about to change separator in parseFilters from "_" to less common symbol, for example "__" or something else.

I agree. I quickly looked into the code and saw a comment of my own that I wanted to change filters to use JSON. At first sight I do not know if we still need a separator then. Anyway, the way filters are passed should be optimized.

I send a pull request with some fixes. But I think this is temporary implementation.
So, what you want to do with filters?

I think we need a intuitive JSON object for filtering. It is easy for key:value pairs that are AND ed together in SQL:

{ "color": "blue", "size":"big" }

with color and size being the column names. But we also need OR queries and query operators like >= or LIKE "string%". The task would be to specify a JSON structure that handles at least the most common cases in a readable way. The JSON is then deserialized in python and converted into a raw sql query.

filter have been rewritten using better json