The errors are relatively obvious to be frank - see the responses below ...
On 08/06/18 14:56, Avitab Ayan Sarmah wrote:
> Can you tell me what is wrong in my admin.py file because from
> exception it seems that list_display() is having something wrong which
> I am not able to find out
>
> On Fri 8 Jun, 2018, 7:23 PM Mario R. Osorio, <
nimbi...@gmail.com
> <mailto:
nimbi...@gmail.com>> wrote:
>
> Looks like you skiped a huge part of the tutorial. you might to go
> back...
>
> On Thursday, June 7, 2018 at 11:08:15 AM UTC-4, Avitab Ayan Sarmah
> wrote:
>
> In windows powershell:
>
> ERRORS:
> <class 'polls.admin.QuestionAdmin'>: (admin.E108) The value of
> 'list_display[0]' refers to 'question_text', which is not a
> callable, an attribute of 'QuestionAdmin', or an attribute or
> method on 'polls.Question'.
>
In your list_display field (on your QuestionAdmin) refers to a field
'question_text' which doesn't exist on either the QuestionAdmin or the
Question model; i.e. that field does not exist in either model.
> <class 'polls.admin.QuestionAdmin'>: (admin.E108) The value of
> 'list_display[1]' refers to 'pub_date', which is not a
> callable, an attribute of 'QuestionAdmin', or an attribute or
> method on 'polls.Question'.
>
In your list_display field (on your QuestionAdmin) refers to a field
'pub_date' which doesn't exist on either the QuestionAdmin or the
Question model; i.e. that field does not exist in either model.
>
> <class 'polls.admin.QuestionAdmin'>: (admin.E116) The value of
> 'list_filter[0]' refers to 'pub_date', which does not refer to
> a Field.
>
In your list_filter field (on your QuestionAdmin) refers to a field
'pub_date' which doesn't exist on either the QuestionAdmin or the
Question model; i.e. that field does not exist in either model.
To be honest the error message you got says exactly what the problem is
- the fields that you think exist don't exist. You need to check your
models, and check the field names, spellings etc.
> <mailto:
django-users...@googlegroups.com>.
> <mailto:
django...@googlegroups.com>.
> <
https://groups.google.com/d/msgid/django-users/8c65b7f0-9ca7-4e07-8167-fb29274710e1%40googlegroups.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...@googlegroups.com
> <mailto:
django-users...@googlegroups.com>.
> <mailto:
django...@googlegroups.com>.
>
https://groups.google.com/d/msgid/django-users/CAEx5wm7JH77g9JfU%3DzHY3%2BCiDbnD3vDnaXLy%3DV1mE8E2wCrd2g%40mail.gmail.com
> <
https://groups.google.com/d/msgid/django-users/CAEx5wm7JH77g9JfU%3DzHY3%2BCiDbnD3vDnaXLy%3DV1mE8E2wCrd2g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
--
Anthony Flury
email : *
Anthon...@btinternet.com*
Twitter : *@TonyFlury <
https://twitter.com/TonyFlury/>*