Hello,

I thought I would check here first to see if what I am experiencing
is, in fact, a bug (using Django 1.0.2).

The admin site JavaScript, when creating a new instance of a model
with a DateTimeField, attempts to focus on an element that does not
exist.  Take this example:

class Reservation(models.Model):
    start_date = models.DateTimeField(blank=False, null=False)

This results in the use of the AdminSplitDateTime widget being used.
The two respective HTML fields have IDs of "id_start_date_0" and
"id_start_date_1".  However, the JavaScript that is generated is:

document.getElementById("id_start_date").focus();

This fails, due to there not being an element on the page with an ID
of "id_start_date".

I tracked this down to the _auto_id method within the BoundField
class.  Creating the "auto_id" depends on the field's "html_name" --
in the case outlined above, both fields have html_name's of
"start_date".

Is this a bug?

Cheers,
Ryan

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to