def __init__(self, request): self.user_agent = request.headers.get('User-Agent') self.remote_addr = request.remote_addr self.firstactivity = datetime.now() self.lastactivity = None self.update() dbsession.add(self) dbsession.flush()
def doit(input, output): try: function, hContext, inparams = input hresult, outparams = output opclass = operation.getclassfor(function) op = opclass(function, hContext, **inparams) op.performed(hresult, **outparams) dbsession.add(op) finally: dbsession.flush() dbsession.remove()
def __init__(self, session, value, implementation): self.session_uid = session.uid self.value = value dbsession.add(self) dbsession.flush()
def __init__(self, value, context): self.value = value self.context_uid = context.uid context.handles.append(self) dbsession.add(self) dbsession.flush()