Facing_error_while_creating_question_in_shell

50 skatījumi
Pāriet uz pirmo nelasīto ziņojumu

sahil gupta

nelasīta,
2021. gada 30. marts 08:59:1530.03.21
uz Django users
from django.utils import timezone
>>> q = Question(question_text="What's new?", pub_date=timezone.now())
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Users\DELL\Envs\test3\lib\site-packages\django\db\models\base.py", line 501, in __init__
    raise TypeError("%s() got an unexpected keyword argument '%s'" % (cls.__name__, kwarg))
TypeError: Question() got an unexpected keyword argument 'question_text'


Ashima jain

nelasīta,
2021. gada 30. marts 09:04:3030.03.21
uz django...@googlegroups.com
its a type error

--
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/5c968208-a9e0-4426-af8e-ede7ee5855d3n%40googlegroups.com.

sahil gupta

nelasīta,
2021. gada 30. marts 09:57:4430.03.21
uz django...@googlegroups.com
unable to figure out it, please do help


Ashima jain

nelasīta,
2021. gada 30. marts 10:00:1330.03.21
uz django...@googlegroups.com
sahil which model u use ..plz mentioned in detail

sahil gupta

nelasīta,
2021. gada 30. marts 10:29:5930.03.21
uz Django users
models.png

Ashima jain

nelasīta,
2021. gada 30. marts 10:37:1530.03.21
uz django...@googlegroups.com
okk sahil wait for sometime I sharing ur problems with my team_mates 

sahil gupta

nelasīta,
2021. gada 30. marts 11:58:0630.03.21
uz Django users
ok fine , please do share

Rama akki

nelasīta,
2021. gada 30. marts 19:44:3830.03.21
uz django...@googlegroups.com
you may not have or error while writing key argument 'question_text' please see in your data base model

Ashima jain

nelasīta,
2021. gada 30. marts 22:50:1830.03.21
uz django...@googlegroups.com
I think you don't declare any field name

Ashima jain

nelasīta,
2021. gada 30. marts 22:52:2730.03.21
uz django...@googlegroups.com
& check ur code oncs again

Ashima jain

nelasīta,
2021. gada 30. marts 22:52:5430.03.21
uz django...@googlegroups.com
check ur settings

Ashima jain

nelasīta,
2021. gada 30. marts 23:02:2430.03.21
uz django...@googlegroups.com
did u import timezone in ur model

Ashima jain

nelasīta,
2021. gada 30. marts 23:03:4430.03.21
uz django...@googlegroups.com
any migration is pending

Ashima jain

nelasīta,
2021. gada 30. marts 23:08:3230.03.21
uz django...@googlegroups.com
ur pub_date is bad practice & remove timezone from ur views

On Tue, Mar 30, 2021, 18:28 sahil gupta <sahilgup...@gmail.com> wrote:

Ashima jain

nelasīta,
2021. gada 30. marts 23:09:3830.03.21
uz django...@googlegroups.com
& run migrations

sahil gupta

nelasīta,
2021. gada 31. marts 07:21:1831.03.21
uz django...@googlegroups.com
Worked , issue resolved thanks for your help

Ashima jain

nelasīta,
2021. gada 31. marts 08:31:0831.03.21
uz django...@googlegroups.com
Atbildēt visiem
Atbildēt autoram
Pārsūtīt
0 jauni ziņojumi