So today , when i was learning Django shell interface for Database , i faced a very strange issue.
I couldn't get the updated the data even after doing the save method .
I searched about this issue, but in all those queries, they where missing save method.
Is this some django update issue or Am i Missing something?
>>> from hello.models import user
>>> user.objects.all()
<QuerySet []>
>>> user1 = user("rins","[email protected]","9995584433","2000-01-01")
>>> user1.save
<bound method Model.save of <user: [email protected]>>
>>> user.objects.all()
<QuerySet []>
So this is the output. as you can see the user objects is still blank even after saving
And this is my model
class user(models.Model):
name=models.CharField(max_length=30)
email=models.CharField(max_length=30)
phone=models.CharField(max_length=11)
dob=models.DateField()
There are two mistakes here:
.save()
, (so with parenthesis); andid
.In the session, you thus can write this as: