biodiv / anycluster

Server-side clustering of map markers for (Geo)Django
MIT License
106 stars 21 forks source link

Change separator in parseFilters method #18

Closed vetal4444 closed 10 years ago

vetal4444 commented 10 years ago

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

biodiv commented 10 years ago

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.

vetal4444 commented 10 years ago

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

biodiv commented 10 years ago

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.

biodiv commented 10 years ago

filter have been rewritten using better json