Beispiel #1
0
def run(gid,type=1):
    with dbconfig.Session() as session:
        gmember=GroupMember()
        gmember.gid=gid
        gmember.uid=BackEndEnvData.uid
        gmember.type=type
        session.merge(gmember)
        session.commit()
    return Res()
Beispiel #2
0
def run(name,board,type=0,position=None):
    with dbconfig.Session() as session:
        newgroup=Group()
        newgroup.creator=BackEndEnvData.uid
        newgroup.group_name=name
        newgroup.group_board=board
        newgroup.type=type
        newgroup.group_postion=position
        newgroup=session.merge(newgroup)
        session.commit()
        gmember=GroupMember()
        gmember.gid=newgroup.gid
        gmember.uid=BackEndEnvData.uid
        gmember.type=0
        session.merge(gmember)
        session.commit()
        return Res({'gid':newgroup.gid})
Beispiel #3
0
def run(name,board,type=0,position=None,lat=None,long=None):
    with dbconfig.Session() as session:
        newgroup=Group()
        newgroup.creator=BackEndEnvData.uid
        newgroup.group_name=name
        newgroup.group_board=board
        newgroup.type=type
        newgroup.group_postion=position
        if lat and long:
            newgroup.lat=lat
            newgroup.long=long
            newgroup.geokey=CombineGeo(long=long,lat=lat)
        newgroup=session.merge(newgroup)
        session.commit()
        gmember=GroupMember()
        gmember.gid=newgroup.gid
        gmember.uid=BackEndEnvData.uid
        gmember.type=0
        session.merge(gmember)
        session.commit()
        return Res({'gid':newgroup.gid})