Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with python 2.6 - empty format placeholders #32

Closed
spapas opened this issue Dec 23, 2013 · 1 comment
Closed

Bug with python 2.6 - empty format placeholders #32

spapas opened this issue Dec 23, 2013 · 1 comment

Comments

@spapas
Copy link

spapas commented Dec 23, 2013

First of all kudos for django-datatable-view, i find it really helpful !

Now, I have found a bug when I tried to use it with python 2.6. In the file datatableview/helpers.py, line 86 there is the following code

return u"""<a href="{}">{}</a>""".format(instance.get_absolute_url(), text)

However, empty placeholders for format are not allowed in python 2.6 (it throws a ValueError: zero length field name in format, also check the answer to this SO question http://stackoverflow.com/questions/10054122/valueerror-zero-length-field-name-in-format-python) - in 2.7 it is working fine.

I was able to fix it by changing the above line to:

return u"""<a href="{0}">{1}</a>""".format(instance.get_absolute_url(), text)

I'd really appreciate it if you apply the fix and put the new version in your pip repository.

Best regards,
Serafeim

@tiliv tiliv closed this as completed in 4e8c495 Dec 23, 2013
@tiliv
Copy link
Contributor

tiliv commented Dec 23, 2013

This will go out in a pip release shortly. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants