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
Fix 'title' template filter #443
Conversation
Fix issue jieter#438 and make the filter work more correctly with non unicode letters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've added two comments.
title = keep_lazy_text(title) | ||
except ImportError: | ||
from django.utils.functional import lazy | ||
title = lazy(title, six.text_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment for what version of Django this shim can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
return ' '.join([ | ||
any([c.isupper() or c.isdigit() for c in w]) and w or old_title(w) | ||
for w in value.split() | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on the performance implementation vs the old one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
I guess the lazyness will add a bit of overhead too, but since django is littered with lazy evaluation, it should not be too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ygwain merged, thanks! |
released 1.7.0 |
cool, thnx
…On Thu, Jun 1, 2017 at 10:48 AM, Jan Pieter Waagmeester < ***@***.***> wrote:
released 1.7.0 <https://pypi.python.org/pypi/django-tables2/1.7.0>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#443 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB1UJg8jT09IkqcHTaL8fE0qXE61f906ks5r_mzdgaJpZM4NaZ2Y>
.
|
Fix issue #438 and make the filter work more correctly with non unicode letters)