Ejemplo n.º 1
0
    def _add_user_to_schedule(self, userid, scheduleid, order=0):
        schedulepath = SchedulePath()
        schedulepath.path = 'user'
        schedulepath.schedule_id = scheduleid
        schedulepath.pathid = userid
        schedulepath.order = order

        self.add_me(schedulepath)
Ejemplo n.º 2
0
    def _add_user_to_schedule(self, userid, scheduleid, order=0):
        schedulepath = SchedulePath()
        schedulepath.path = "user"
        schedulepath.schedule_id = scheduleid
        schedulepath.pathid = userid
        schedulepath.order = order

        self.add_me(schedulepath)
Ejemplo n.º 3
0
def add_user_to_schedule(session, userid, scheduleid, order=0):
    schedulepath = SchedulePath()
    schedulepath.path = 'user'
    schedulepath.schedule_id = scheduleid
    schedulepath.pathid = userid
    schedulepath.order = order

    with flush_session(session):
        session.add(schedulepath)
Ejemplo n.º 4
0
def add_user_to_schedule(session, userid, scheduleid, order=0):
    schedulepath = SchedulePath()
    schedulepath.path = 'user'
    schedulepath.schedule_id = scheduleid
    schedulepath.pathid = userid
    schedulepath.order = order

    session.begin()
    try:
        session.add(schedulepath)
        session.commit()
    except Exception:
        session.rollback()
        raise