Skip to content

Django 1.2 and invalid exclude definition in admin.py #2

@restless

Description

@restless

When I enter admin panel I get an error saying that "exclude refers to field created_on that is missing from the form."

The problem is caused by the following definition (admin.py):

class WorkflowAdmin(admin.ModelAdmin):
    """
    Workflow administration
    """
    (...)
    exclude = ['created_on', 'cloned_from']
    list_filter = ['status']

It is enough to remove created_on from the exclude (exclude = ['cloned_from']). created_on field is defined as auto_now_add which makes it automatically editable=False, so it is not included in the form generated for admin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions