#7717: python now() and javascript now-button in admin not the same
-----------------------------+----------------------------------------------
Reporter: mikaelm | Owner: nobody
Status: new | Milestone: post-1.0
Component: Admin interface | Version: newforms-admin
Keywords: now_button | Stage: Unreviewed
Has_patch: 0 |
-----------------------------+----------------------------------------------
If you have a datetimefield, and press the now button in the admin view
you will enter the local time according to your computers timezone, and
not according to the servers settings. This might confuse the user.
E.g:
You have a blog that do not publish the blog post immediately, but after a
specific date and time. By pressing the "now" button in the django admin
the user would expect the blog post to appear immediately in the blog, but
might not do that if the timezone of the server and the computer differ.
#model.py
class BlogPosts(models.Model):
title = models.CharField(_("title"),max_length=200)
body = models.TextField(_("body"))
visible_after = models.DateTimeField(_("post visible after"))
#views.py
def list(request):
queryset=Post.objects.filter(visble_after__lte=datetime.now).order_by("-visible_after")
return list_detail.object_list(
request,
queryset=queryset,
paginate_by=paginate_by,
page=page_no,
template_name=template_name,
)
This is perhaps not a bug, but might be perceived as such by the users.
One solution would use some ajax-magic that queries the server for the
server's own localtime.
--
Ticket URL: <http://code.djangoproject.com/ticket/7717>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---