Javier Rojas wrote:
> El Sábado 15 Julio 2006 14:58, Christopher Arndt escribió:
> CA> Javier, you have to check in your JS callback function, if the the
> CA> received object really contains an id (untested):
> No, I don't have to. That is the idea of the return statement within the
> if (d["tg_errors"]) block, to not execute anything else.
Please read your code again very carefully:
def addPerson(self,name):
try:
person=m.Person(name=name)
except Exception:
return dict(errors=u"That person already exist")
^^^^^^
return dict(id=person.id,name=person.name)
function dos (d) {
if (d["tg_errors"]) {
^^^^^^^^^
alert(d["tg_errors"])
return
}
[...]
}
Chris
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---