Tuesday, April 24, 2012

Django DateTimePicker only shows up for superusers inside my app

I'm using django DateTimePicker widget -- AdminSplitDateTime() -- in event creating app, every thing goes fine when the loged in user has superuser permissions, but when normal user tries to access the creating form the widget don't show up.

I don't know why it acts like this? and how to overcome this behavior?

this is the the scripts included in my page

    <script type="text/javascript" src="/admin/jsi18n/"></script>
    <script type="text/javascript" src="/static/admin/js/core.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
    <script type="text/javascript" src="/static/admin/js/actions.min.js"></script>
    <script type="text/javascript" src="/static/admin/js/calendar.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin/DateTimeShortcuts.js"></script>

her is my form code

    class Form(ModelForm):
        """
        
        """
        
        class Meta:
            model = Model
            exclude = ('creator')
        def __init__(self, *args, **kwargs):
            super(Form, self).__init__(*args, **kwargs)
            self.fields['start'].widget = widgets.AdminSplitDateTime()
            self.fields['end'].widget = widgets.AdminSplitDateTime()

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/pjxKfBpiamsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate