Created Ojects Are Not Shown Through Cmd Django Python
from sabin.models import Task >>> Task.objects.all() >>> t=Task(title='dhiraj') t=Task(title='dhiraj') t.save() error says when try to save T
Use save()
, it is a method, not an attribute.
t=Task(title="dhiraj")
t.save()
Also, before this, you must run:
>py manage.py makemigrations>py manage.py migrate
And also, to get all objects, it is Task.objects.all()
Post a Comment for "Created Ojects Are Not Shown Through Cmd Django Python"