django : using admin datepicker

后端 未结 3 1562
再見小時候
再見小時候 2020-12-29 10:46

I\'m trying to use the admin datepicker in my own django forms.

Roughly following the discussion here : http://www.mail-archive.com/django-users@googlegroups.com/msg

3条回答
  •  悲&欢浪女
    2020-12-29 11:09

    No, it's not a bug.

    It's trying to call the gettext() internationalization function in js. You can do js internationalization much like you do it in python code or templates, it's only a less known feature.

    If you don't use js internationalization in your project you can just put.

    
    

    in your top template so the js interpreter doesn't choke.

    This is a hacky way to solve it I know.

    Edit:

    Or you can include the exact jsi18n js django admin references to get it working even with other languages. I don't know which one it is.

    This was posted on django-users today:

    http://groups.google.com/group/django-users/browse_thread/thread/2f529966472c479d#

    Maybe it was you, anyway, just in case.

提交回复
热议问题