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.

On Tue, Jan 10, 2023 at 9:23 PM David Nugent <dav...@uniquode.io> wrote:

> 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" <elishamo...@gmail.com>
> To "Django users" <django-users@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
>
> <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'.
>
> --
> 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+unsubscr...@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
> <https://groups.google.com/d/msgid/django-users/em7ab82c5a-9ea2-4ec1-93a9-422b04204273%40a52b871d.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABFHQYx0Pe7%2BVYq5WZ6gbZXQMOHMAmR25UXM_B4txaxso%3D5gWQ%40mail.gmail.com.

Reply via email to