Opened 15 years ago

Closed 15 years ago

#12935 closed (duplicate)

Stange behaviour of admin.ModelAdmin

Reported by: jerzyo Owned by: nobody
Component: Forms Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I encounter a strange error when customizing my admin site

{{{class DataFileAdmin(admin.ModelAdmin):

#form = MyDataFileAdminForm
exclude = ('file')}}}

does not remove the field from the form but

{{{class DataFileAdmin(admin.ModelAdmin):

#form = MyDataFileAdminForm
exclude = ('file',)}}}

does.

Could someone explain it to me what is the role of the ending comma? As far as I know Python, it should have no influence on the interpreter

Change History (2)

comment:1 by jerzyo <jerzyo@…>, 15 years ago

Sorry for wrong formatting it should be

class DataFileAdmin(admin.ModelAdmin):
    #form = MyDataFileAdminForm
    exclude = ('file')
class DataFileAdmin(admin.ModelAdmin):
    #form = MyDataFileAdminForm
    exclude = ('file',)

The one one works, the first one does not

comment:2 by Ramiro Morales, 15 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #12689.

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