remi jolin <[EMAIL PROTECTED]> writes:
> But I must be wrong !!
It all depends... In a standard method with a standard class, the
objects are flushed.
> Today I wrote a small piece of code to update a data based on the
> information received through the URL like this one :
> @expose('json', allow_json=True)
When you say "@expose('json')" you don't need to say "allow_json=True".
> def store_info(self, id, info):
> d = MyData.get(id)
> if not d:
> return dict(state="Nok")
> v = d.value
> d.value=info
> return dict(state="OK", prev_value=v)
>
> If I do http://xxxx:8080/store_info/1/new_data, I get back the json dict
> but the data is not updated (if I enable the DB engine echo, I can see
> the commit but no update). Is it the normal behavior ?
> It is only updated if I force a flush (session.flush()) before the return.
Despise the indentation above be wrong -- I'm assuming it was just a
copy & paste problem --, it should work.
Can you trascribe the commands issued and shown with the echo from SA?
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---