Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#12835 closed (duplicate)

Setting date fields on new admin inlines does not work.

Reported by: jbronn Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: admin inline date
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The problem is that the date and time form fields do not autocomplete when clicking the "Today" link or selecting a date from the calendar widget. This occurs only on newly added inline models, e.g., after hitting the "Add another" link. Example code below may be used to reproduce this bug.

models.py:

from django.db import models

class Place(models.Model):
    name = models.CharField(max_length=32)
    def __unicode__(self): return self.name

class Person(models.Model):
    name = models.CharField(max_length=32)
    dob = models.DateTimeField()
    place = models.ForeignKey(Place)
    def __unicode__(self): return self.name

admin.py:

from django.contrib import admin
from models import Person, Place

class PersonInline(admin.StackedInline):
    model = Person

class PlaceAdmin(admin.ModelAdmin):
    inlines = [
        PersonInline,
        ]

admin.site.register(Person)
admin.site.register(Place, PlaceAdmin)

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #12705

comment:2 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.