#29636: Failing admin.E108 system check after upgrading to Django 2.1
-------------------------------------+-------------------------------------
Reporter: petrboros | Owner: nobody
Type: Bug | Status: new
Component: Core (System | Version: 2.1
checks) |
Severity: Normal | Resolution:
Keywords: SystemCheckError | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by petrboros:
Old description:
> After upgrading to Django 2.1, we have system checks failing due to
> `admin.E108` `SystemCheckError`. This behavior was not present in Django
> 2.0.8. I don't see any relevant API change documented in the 2.1 Release
> notes, therefore I'm filling this as a bug.
>
> The error:
> {{{
> <class 'automation.admin.TriggerAdmin'>: (admin.E108) The value of
> 'list_display[3]' refers to 'position', which is not a callable, an
> attribute of 'TriggerAdmin', or an attribute or method on
> 'automation.Trigger'.
> }}}
>
> The `automation.admin.TriggerAdmin` class:
> {{{
> from django.contrib import admin
> from automation.models import Trigger
>
> @admin.register(Trigger)
> class TriggerAdmin(admin.ModelAdmin):
> model = Trigger
> list_display = ('company', 'trigger_type', 'action_type', 'position')
> list_filter = ('company', 'trigger_type', 'action_type')
> }}}
>
> The `automation.models.Trigger` model (abbreviated):
> {{{
> from django.db import models
> from core.fields import PositionField
>
> class Trigger(models.Model):
> position = PositionField(
> verbose_name=_('Priority'),
> collection='company'
> )
>
> (...)
> }}}
>
> The `core.fields.PositionField` field (abbreviated, originally taken from
> the `django-positions` package):
> {{{
> from django.db import models
>
> class PositionField(models.IntegerField):
> (...)
> }}}
New description:
After upgrading to Django 2.1, we have system checks failing due to
`admin.E108` `SystemCheckError`. This behavior was not present in Django
2.0.8. I don't see any relevant API change documented in the 2.1 Release
notes, therefore I'm filing this as a bug.
The error:
{{{
<class 'automation.admin.TriggerAdmin'>: (admin.E108) The value of
'list_display[3]' refers to 'position', which is not a callable, an
attribute of 'TriggerAdmin', or an attribute or method on
'automation.Trigger'.
}}}
The `automation.admin.TriggerAdmin` class:
{{{
from django.contrib import admin
from automation.models import Trigger
@admin.register(Trigger)
class TriggerAdmin(admin.ModelAdmin):
model = Trigger
list_display = ('company', 'trigger_type', 'action_type', 'position')
list_filter = ('company', 'trigger_type', 'action_type')
}}}
The `automation.models.Trigger` model (abbreviated):
{{{
from django.db import models
from core.fields import PositionField
class Trigger(models.Model):
position = PositionField(
verbose_name=_('Priority'),
collection='company'
)
(...)
}}}
The `core.fields.PositionField` field (abbreviated, originally taken from
the `django-positions` package):
{{{
from django.db import models
class PositionField(models.IntegerField):
(...)
}}}
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29636#comment:1>
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/067.8ae033e59c0f33c596a3398c12f8cc9c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.