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

Add localtime_for_user filter #9

Open
paltman opened this issue Feb 1, 2011 · 1 comment
Open

Add localtime_for_user filter #9

paltman opened this issue Feb 1, 2011 · 1 comment

Comments

@paltman
Copy link

paltman commented Feb 1, 2011

turn this:

{{ match.start|localtime:request.user.account_set.all.0.timezone|date:"n/d/y"}}

into this:

{{ match.start|localtime:request|date:"n/d/y"}}

In addition, pull the timezone out of session if it is there than hitting the database every single usage of the template filter.

I realize that this is a boundry crossing into Accounts so might be more appropriate elsewhere.

@jezdez
Copy link
Contributor

jezdez commented Feb 2, 2011

Maby adding a TIMEZONES_USERTIME_CALLBACK setting that would be a dotted path to a callable that is passed a datetime and a user object. Then a usertime filter could easily call that and an account app could implement the specific ORM call.

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