Thanks for all your answers.
Solution :
http://stackoverflow.com/questions/31534715/cant-update-extended-user-django-model
--
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
Did you "python manage.py migrate"?
2015-07-21 15:07 GMT+06:00 Info Test :
> Any error appear on console, is it possible that only superuser can do
> that?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group
Any error appear on console, is it possible that only superuser can do that?
--
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...@googlegroup
Are you getting any sort of error when you run save()? Are the changes
reflected in the database after the save() call? Can you perform the same
operation directly on the user object?
Also, this operation shouldn't require any arguments to save().
-James
On Jul 21, 2015 1:43 AM, "Info Test" wrot
Even with p.save(force_update = True) , it doesn't work
--
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 post to thi
You didn't call p.save() anywhere, so the change you made wasn't committed
to the database. All you've done here is made a change to the object in
memory you pulled out of the database, and then over wrote that change by
pulling another copy out of the database.
-James
On Jul 21, 2015 12:55 AM, "
Le mardi 21 juillet 2015 10:55:19 UTC+3, Info Test a écrit :
>
> When I save my model, there is no effect in database.
> What is the problem?
>
> class Profil(models.Model):
> user = models.OneToOneField(User)
>
>
> in manage.py shell
>
> >>> p = models.Profil.objects.get(user__username='test
When I save my model, there is no effect in database.
What is the problem?
class Profil(models.Model):
user = models.OneToOneField(User)
in manage.py shell
>>> p = models.Profil.objects.get(user__username='testname')
>>> p.user.is_superuser
False
>>> p.user.is_superuser = True
>>> p.user.i
8 matches
Mail list logo