Hi all,
forgive me for asking.
I have a little problem, since I'm newbie on python, I dont have any
clue to solve this problem.
My problem is, I have a save procedure with update command.
the tg log said it is correct UPDATE sql command with commit command.
but when I look on my database, the record is gone, looks like this
record has been delete.
I dont know why its happen.
I'm using postgresql 8.3 and tg2.
Here are parts of my code.
=============================================
The Header :
"""Currencies Controller"""
#from administrator.lib.base import Controller
from administrator.lib.base import BaseController
from tg import expose, redirect, flash
from pylons.i18n import ugettext as _
from turbojson.jsonify import jsonify, encode as json_encode
from administrator.model import DBSession, metadata
from administrator.model.currencies import Currencies
import transaction
The class :
class CurrenciesController(BaseController):
#similar with index.htm
@expose('administrator.templates.currencies.index')
def currencies(self):
currencies_rs = DBSession.query(Currencies)
return dict(title='Currencies', currencies_view=currencies_rs)
def save(self, currency_id, currency_name, currency_symbol,
currency_status):
currency = DBSession.query(Currencies).filter_by(currency_id =
currency_id).one()
currency.name = currency_name
currency.symbol = currency_symbol
currency.status = currency_status
Forgive me for my english skill.
Please advice.
Thank you
kang bedjo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---