Code

Opened 4 years ago

Closed 4 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

Attachments (0)

Change History (2)

comment:1 Changed 4 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 4 years ago by ramiro

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

Duplicate of #12689.

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.