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

Feature/translatable #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stefanfoulis
Copy link

I added a new sort_anchor templatetag that supports context variables. This makes some new things possible:
e.g

{% sort_anchor "myfiled" _("My Translated Title") %}

or

{% for field in fields %}
    {% sort_anchor field.name field.title %}
{% endfor %}

I've left the anchor templatetag in place for now for backwards compatibility. The new tag also has a smaller chance of creating conflicts with other templatetag libraries.

… context variables and translated labels. the original 'anchor' tag was left in place for backwards compatibility.
@stefanfoulis
Copy link
Author

ping :-)

@rtpm
Copy link

rtpm commented May 30, 2011

As for {% for field in fields %} where do you get fields var from?

I think there should be an option using {% sort_anchor 'field_name' %} that would take title from model's field verbose_name=ugettext_lazy("test"). If you change the verbose_name of the field, you would only need to change the models.py file.

Or maybe I am missing something and there is some simple way of doing this the other way?

Anyway, thanks for your great addition. That helped me a lot!

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

Successfully merging this pull request may close these issues.

2 participants