Open xinity opened 9 years ago
We would have to add something like django-filter (see http://www.django-rest-framework.org/api-guide/filtering/#djangofilterbackend) for this to work - I have no objection to doing that?
I'm not a python dev but i can at least try considering i've failed implementing instances alert, let's see if I can do better this time
It's pretty much a case of following the instructions I think, let me know if you get stuck
I'll let you know by next week-end @dbuxton anychances you could give a guideline so i can solve and make PR related to issue #204 ?
i have a working PoC for graphite_checks, sadly , Django fulltext search doesn't support Postgresql :( so i was only able to search using "starts with" and "exact" terms.
if that's enough, i can PR for all checks, let me know @dbuxton
You should be able to do icontains
?
@dbuxton that's what is already done : " def construct_search(self, field_name): if field_name.startswith('^'): return "%sistartswith" % field_name[1:] elif field_name.startswith('='): return "%siexact" % field_name[1:] elif field_name.startswith('@'): return "%s__search" % field_name[1:] else: return "%s__icontains" % field_name" <=== !!
maybe using tsearch2 or tools alike, but i'm afraid it's far beyond my skills :(
I don't understand what's wrong with this. Do you have a development branch with your changes in that I can have a look at?
not at this time, but i can make one fast if needed.
as today i found a dirty workaround using jq to dynamically built my API's queries. feel free to close this issue if not interested in full text search with django REST API's using postgresql
hi all,
I'm trying to search for example, all graphite_checks which name field contain : mydomain.com
i've tried this type of query: http://cabot:8080/api/graphite_checks/?search=mydomain doesn't return anything
but this works: http://cabot:8080/api/graphite_checks/?name=mysrv.mydomain.com
have i missed something, i've taken a closer look at Django Rest Framework documentation, but i haven't found how to fullfill my needs :(
any clues ?
thanks a lot guys,
Regards,