Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#5954 closed (duplicate)

inline extra fields are required

Reported by: LongMan <alx.gsv@…> Owned by: nobody
Component: contrib.admin Version: newforms-admin
Severity: Keywords: edit inline extra required
Cc: alx.gsv@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

models.py

class Student(models.Model):
    ...

class GosExamMark(models.Model):
    student = models.ForeignKey('Student')
    ...

class GosExamMarkTabular(admin.TabularInline):
    model =  GosExamMark
    extra = 1

class StudentOptions(admin.ModelAdmin):
    model = Student
    inlines =  [GosExamMarkTabular, ...]

diplomCorectorSite = admin.AdminSite()
diplomCorectorSite.register(Student, StudentOptions)

When i'm editing one of Student odjects trough admin site i got error in extra object form that tells me fields are required.
But i dont want to add new inline object - i just want to edit Student object.

Change History (3)

comment:1 by Brian Rosner, 16 years ago

Resolution: duplicate
Status: newclosed

You really didn't provide enough information on why they are being required. However, if you have specified a default value for a field that is being edited inline then it will fail. This is fundamentally because of #5878. I am going to mark this as a duplicate. The last merge with trunk brought over #899 which is now causing this behavior. If you can provide some more information that does not have anything to do with a model field's default value, please by all means reopen.

comment:2 by sjulean, 16 years ago

The example in the description has nothing to do wtih default values - this is a duplicate of #5828 (applying the patch in #5828 fixes the problem).

comment:3 by LongMan <alx.gsv@…>, 16 years ago

Thank you sjulean for your help! :)
My svn tells me my newforms-admin is up-to-date. But problem exists. Does it mean that this patch not applied to the brach?

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