Hi,
Django Reference suggests that we use Transaction Middleware in the
web applications.
What is the usual practice followed here? Do we use Transaction
Middleware most of the time?
The reason why I am asking is due to the following reason:
In my code, I at many places do the following
Obj = Model(parm1, parm2)
Obj.save()
# Now store the id for future use
l.append(Obj.id)
etc.
Now, I think this sort of code should be very usual in Web
Applications. But I cannot understand how this will work, since as per
my understanding, the _id_ will not be obtained until the DB actually
assigns one. Since transaction middleware allows the transaction to be
commited only at the end, this should fail right?
So, I wonder whether there is something missing in my code (say -
do transaction.commit() myself etc), if everybody does use transaction
middleware.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---