There is no way to use admin's calendar into regular pages with
newforms. You have to implement it by yourself.

On 3 сент, 11:07, picky <[EMAIL PROTECTED]> wrote:
> That's what I was thinking. I try it but I don't fuind how to display
> calendar button.
> I don't see anything in http code of an admin page which contains a
> DateField.
>
> Mathieu
>
> On Sep 1, 11:47 pm, "Peter Melvyn" <[EMAIL PROTECTED]> wrote:> On 8/31/07, 
> picky <[EMAIL PROTECTED]> wrote:
>
> > > I try to create a form with forms.form_for_model but I just get a text
> > > widget for my DateField object.
>
> > I did not try it yet, but in principle, you should set class attribute
> > of corresponding widget to vDateField and include related JavaScripts
> > from
> > contrib.admin.media.js.admin folder.
>
> > To set attribute, you can do it this way:
>
> > MyForm = forms.form_for_model(...)
> > MyForm.base_field['my_field'].widget.attrs.update({'class':'vDateField'})
>
> > Peter


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to