At first, I tried to search in this group, but only got an un-answered
question similar to mine:
http://groups.google.com/group/django-users/browse_thread/thread/767716b62a244b33/85b8203990407a6c?lnk=gst&q=transaction+default#85b8203990407a6c
in my settings.py, i am using TransactionMiddleware. and my testing
views.py as following:
def index(request):
c=Myobject.objects.get(pk=45) ###Myobject with a field 'isUpdate'
which default value is False.
c.isUpdate = True
c.save()
raise NameError
after a request to this index view, I found in database that object's
'isUpdate' was set to True...
then I added an decorator:
@transaction.commit_on_success
def index(request):
c=Myobject.objects.get(pk=45)
.....
Then the object won't be changed.
I am confused about this, because according to the Django document
about transaction, I think the default way is just commit_on_success?
or what mistake I have made?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---