﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29682	Admin change form crashes if a view-only model's form has field not on the model	Jones	nobody	"Viewing an existing view-only object crashes with:
{{{
AttributeError at /admin/t29682/modela/1/change/
Unable to lookup 'form_field' on ModelA or ModelAAdmin
}}}

{{{

class ModelAForm(forms.ModelForm):

    class Meta:
        model = ModelA
        fields = '__all__'

    form_field = forms.BooleanField(
        label=""Form Field"",
        required=False,
        widget=forms.CheckboxInput()
    )


class ModelA(models.Model):
    test = models.IntegerField(
        null=True,
        blank=True
    )

@admin.register(ModelA)
class ModelAAdmin(admin.ModelAdmin):

    form = ModelAForm

    fieldsets = (
        ('Test', {
            'fields': (
                'test', 'form_field'
            )
        }),
    )
}}}
"	Bug	new	contrib.admin	2.1	Release blocker				Accepted	0	0	0	0	0	0
