google app engine - How to use services in the way I expose here? in pyamf -
my app sets array of strings available services. when app call "getservicerequest" calls on custom class, must load class match target in available services array.
then problem here; class this. , run render_output everytime run service this. how extend originals classes, , ones? thanks
class get_current_account2(object): def render_output(self, input): self.output = object() data = self.execute(input) self.output.data = data || nil if self.message: self.output.message = self.message return self.output def execute(self, input): app.models.user import user gaesessions import get_current_session google.appengine.ext import db session = get_current_session() if not session: self.message = 'session not found' return if not session.has_key('account.logged'): self.message = 'account not logged' return if not session.has_key('account.email'): self.message = 'account email not found' return if not session.has_key('account.key'): self.message = 'account key not found' return if not session['user.key']: self.message = 'user key not found' return user = user.get(db.key(session.get('user.key'))) if not user: self.message = 'user not found' return user.account = none; return {'logged': session['account.logged'], 'account_key': session['account.key'], 'email': session['account.email'], 'user': user, 'session_sid': str(session.sid)}
Comments
Post a Comment