Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#13041 closed (worksforme)

Error on InlineModel Admin

Reported by: Marcos Daniel Petry Owned by: matiasb
Component: contrib.admin Version: 1.1
Severity: Keywords:
Cc: humitos@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


There is an error in the javascript that renders the buttons of InlineAdmin Forms:

When you have more than one inline in the AdminForm, and one of them has a DateField or DateTimeField, the javascript renders the calendar widget for all of these fields everytime when the button "add item" is clicked

Sorry about my english, in this link[1] has an image that represent this bug

Change History (6)

comment:1 Changed 10 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:2 Changed 10 years ago by matiasb

Owner: changed from nobody to matiasb
Status: newassigned

comment:3 Changed 10 years ago by matiasb

After some debugging, I found it is a problem with the browser's cache and the javascript code.

I created a sample app as described above. When running it in a project using django trunk, I noticed no problem. Then, I installed the app in a django 1.1 site (as the version reported in the ticket is 1.1), and in the admin section the action links for date fields were showing wrong, but with a hard refresh it was solved. After that, I ran again the project under trunk version, and finally that triggered the error reported. However, with a hard refresh everything worked perfectly well.

This means it could be a problem related with cache of the admin javascript files for different django versions. I think it should be closed as invalid.

comment:4 Changed 10 years ago by Manuel Kaufmann

Cc: humitos@… added

I test this issue too, but I had different "". I created a sample app like this:

from django.db import models

# Create your models here.

class MyModel(models.Model):
    date = models.DateField()

class OtherModel(models.Model):
    mymodel = models.ForeignKey(MyModel)
    name = models.CharField(max_length=50)

class AnotherInlineModel(models.Model):
    mymode = models.ForeignKey(MyModel)
    date = models.DateField()
    another_date = models.DateField()
    name = models.CharField(max_length=25)

from django.contrib import admin

from models import *

class OtherModelAdmin(admin.TabularInline):
    model = OtherModel
    #date_hierachy = 'date'

class AnotherInlineModelAdmin(admin.TabularInline):
    model = AnotherInlineModel
    #date_hierachy = 'date'

class MyModelAdmin(admin.ModelAdmin):
    inlines = [
    ], MyModelAdmin), OtherModelAdmin)

I've created a virtualenv to use Django 1.1 and I can't see the button link Add another...

But, if I use Django trunk (1.2 beta 1) I can see the link and everything work correctly.

I think that this ticket isn't a bug.

comment:5 Changed 10 years ago by matiasb

Resolution: worksforme
Status: assignedclosed

I couldn't reproduce the bug (except for what stated in the comment above). You should provide additional information if you see the problem persists.

comment:6 Changed 9 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top