#29927: ModelAdmin.exclude ignored when generating readonly view
-----------------------------------------+------------------------
Reporter: Ben Cole | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Fields added to a `ModelAdmin.exclude` are not excluded when generating a
"readonly" view as per the new functionality
{{{
Class MyModel(models.Model):
field_to_show = models.TextField(default='foo')
field_to_exclude = models.TextField(default='should be hidden')
}}}
{{{
@admin.register(MyModel)
Class MyModelAdmin(admin.ModelAdmin):
exclude = ('field_to_exclude',)
def has_change_permission(self, request, obj=None):
return False
}}}
In the above example the `field_to_exclude` will be rendered on the
"readonly" change view
--
Ticket URL: <https://code.djangoproject.com/ticket/29927>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.1dc8d2080492d019c10925198369f735%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.