any solutions guys on the ERROR admin E108 on list_display[2] attributes not callable

420 views
Skip to first unread message

E Mollz

unread,
Jan 10, 2023, 10:16:31 AM1/10/23
to Django users
<class 'products.admin.ProductAdmin'>: (admin.E108) The value of 'list_display[2]' refers to 'stock', which is not a callable, an attribute of 'ProductAdmin', or an attribute or method on 'products.Product'.

Kasper Laudrup

unread,
Jan 10, 2023, 12:52:37 PM1/10/23
to django...@googlegroups.com
Unfortunately you've run into one of the issues modern science has not
yet been able to solve. Nothing to do about that so you might as well
give up.

Sorry about that.

Kind regards,
Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature

David Nugent

unread,
Jan 10, 2023, 4:23:24 PM1/10/23
to django...@googlegroups.com
This is due to an error in your admin class (ProductAdmin in this case)

The error message points directly where and what you need to check (spoiler: list_display item, 3rd field “stock”, which is incorrect).



------ Original Message ------
From "E Mollz" <elish...@gmail.com>
To "Django users" <django...@googlegroups.com>
Date 1/10/2023 10:53:37 PM
Subject any solutions guys on the ERROR admin E108 on list_display[2] attributes not callable

ASAMOAH EMMANUEL

unread,
Jan 10, 2023, 5:06:00 PM1/10/23
to django...@googlegroups.com
The problem here is that list_display[2] is referring to an attribute or method that does not exist. You will need to either add the attribute or method to the Product class, or remove the item from list_display. If you are looking to display the stock of a product, you could add a method to the Product class to return the stock, then add it to list_display.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/em7ab82c5a-9ea2-4ec1-93a9-422b04204273%40a52b871d.com.
Reply all
Reply to author
Forward
0 new messages