Opened 6 years ago

Closed 6 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: UI/UX:

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 Changed 6 years ago by jerzyo <jerzyo@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 6 years ago by ramiro

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #12689.

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