Collection not filtering integer field - plone.app.querystring

I have an integer field and when I try to create a filter on it it didn't work.

Looking at p.a.querystring code I see that the related operators don't work:

  • plone.app.querystring.operation.int.is
  • plone.app.querystring.operation.int.lessThan
  • plone.app.querystring.operation.int.largerThan

They are mapped to these methods respectively:

And these methods don't convert the value to int (because they are used for other string based types).

Also I tested the plone.app.querystring.operation.selection.is and it fail too with an int field.

Looking at the tests of these methods, you clearly see that it is not testing every kind of data.

My suggestions are to create new methods just for int fields (doing type cast) and to add a new operator for int fields plone.app.querystring.operation.intselection.is (something like this)

Can someone confirm this as a bug? Thanks

Does the portal_catalog behave differently?
For example, do portal_catalog(my_index={'query': 1, 'range': max}) or portal_catalog(my_index=1) do what you expect?

hi @jaroel thank you for the reply, well, my question is related with default collection type, not catalog query.

I did a pull request to fix the problem while ago https://github.com/plone/plone.app.querystring/pull/33/files https://github.com/plone/plone.app.querystring/pull/34/files

Oh yeah, I was just wondering if the catalog supported it.

Thanks for the pull request. Nice work!