Pegase745 / sqlalchemy-datatables

SQLAlchemy integration of jQuery DataTables >= 1.10.x (Pyramid and Flask examples)
MIT License
159 stars 67 forks source link

Cast regex to string to allow searching of numerical values #61

Closed Chris7 closed 7 years ago

Chris7 commented 8 years ago

When using this with Django and searching for numerical values, this error arises:

Traceback (most recent call last):
  ...
  File "/usr/local/lib/python2.7/dist-packages/datatables/__init__.py", line 172, in __init__
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/datatables/__init__.py", line 223, in run
    self.filtering()
  File "/usr/local/lib/python2.7/dist-packages/datatables/__init__.py", line 319, in filtering
    regex = clean_regex(searchValue)
  File "/usr/local/lib/python2.7/dist-packages/datatables/__init__.py", line 62, in clean_regex
    ret_regex = ret_regex.replace('\\','')
AttributeError: 'int' object has no attribute 'replace'

This casts the regex to a string to avoid this error.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 87.156% when pulling 4e298f86829fdc0d5de48351012ad6fdf0dba009 on Chris7:cast-search-regex into 096ace624a3ca68f2d4aad6721547777ed38a98e on Pegase745:master.

louking commented 8 years ago

This is fixed already in pull request #55

Chris7 commented 8 years ago

@louking Thanks for the heads up. Personally, I would remove the version changes in your PR as I would never accept a PR to my own projects that updated my versioning.

louking commented 8 years ago

Thanks @Chris7 . @Pegase745 has taken other similarly versioned changes from me, and updated the version himself. However if he wants these removed I'd be happy to. I use it in my personal fork so that I can tell the difference from the source version. There may be a better way to do this, though.

tdamsma commented 7 years ago

I am closing the PR as this should be covered in >1.0.0

Chris7 commented 7 years ago

Any idea when the latest will be put on pypi?

Pegase745 commented 7 years ago

The latest is already on pypi. The few commits after the 1.2.0 are example/doc related so no real impact on the lib usage.

Le 13 avr. 2017 7:09 PM, "Chris Mitchell" notifications@github.com a écrit :

Any idea when the latest will be put on pypi?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pegase745/sqlalchemy-datatables/pull/61#issuecomment-293960331, or mute the thread https://github.com/notifications/unsubscribe-auth/ABmd0e55lcyzQM-x1jJwB_QAymZPJvpQks5rvlRAgaJpZM4JuGkO .