Git Product home page Git Product logo

Comments (4)

bennullgraham avatar bennullgraham commented on July 26, 2024

Thanks for the detailed report! Yes, this is a bug. I came across this recently and it had been so long since writing the library that I got confused by it myself!

CharFilter currently uses Django's forms.CharField to convert the raw query input into a Python object before Filternaut works with it. With CharFilter this is basically a no-op since it runs str() in the input and the input is already a string, but if you use e.g. DateTimeFilter then raw input of '2017-01-01' is turned into a datetime instance, which is useful.

Anyway, this falls apart with multi-valued input as the conversion is applied to the raw input as-is; so CharFilter ends up running str() on ['one', 'two', 'three'] and you get the result described above.

If you're interested in making a patch, https://github.com/bennullgraham/filternaut/blob/master/filternaut/filters.py#L44 probably needs to special-case input which appears to be a list, tuple, etc. Otherwise, I'll fix when I get a chance!

from filternaut.

bennullgraham avatar bennullgraham commented on July 26, 2024

Turns out I got a chance fairly quickly :)

@jameswyse can you check that the fix/multi-clean branch (https://github.com/bennullgraham/filternaut/tree/fix/multi-clean) fixes or would appear to fix your case?

from filternaut.

jameswyse avatar jameswyse commented on July 26, 2024

Thanks for the detailed response! (and then for fixing it!)

Your branch does appear to fix the problem I was seeing 😁

from filternaut.

bennullgraham avatar bennullgraham commented on July 26, 2024

Fixed in 0.0.9 which is now on PyPI. Thanks again for the ticket 👍

from filternaut.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.