dummy-code from the tg-crud template:
def save(self, id=None, **kw):
"""Save or create record to model"""
#update kw
#create
if not id:
Eins(**kw)
flash("Eins was successfully created.")
raise redirect("list")
#update
else:
record = Eins.get(int(id))
for attr in kw:
setattr(record, attr, kw[attr])
flash("Eins was successfully updated.")
raise redirect("../list")
HTH,
Frank
2007/5/29, Christopher Singley <[EMAIL PROTECTED]>:
> Speaking of dictionary-based object methods - reference
> http://wiki.sqlobject.org/dictionarymapping.html
>
> is this INSERT only, or does it somehow also work for UPDATE,
> as the link reference would seem to indicate?
>
> Anbody ever used this?
> TIA
> cs
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> sqlobject-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss