当前位置: 首页>>代码示例>>Python>>正文


Python Activity.createSession方法代码示例

本文整理汇总了Python中Activity.createSession方法的典型用法代码示例。如果您正苦于以下问题:Python Activity.createSession方法的具体用法?Python Activity.createSession怎么用?Python Activity.createSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Activity的用法示例。


在下文中一共展示了Activity.createSession方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: authenticate

# 需要导入模块: import Activity [as 别名]
# 或者: from Activity import createSession [as 别名]
 def authenticate(self, user_name, pswd):
     """
     Validates the user's credentials. If are valid, returns
     a user object (minus the password hash).
     """
     #login = login.strip()
     #password = password.strip()
     rslt = ldap_auth(user_name,pswd)
     if rslt:
         self.db_session = Activity.createSession('try')
         user = Activity.getUser(self.db_session,user_name)  
         if not user: 
             #user in LDAP but not in our DB
             return
         else:
             del user['password']
             return user
     else :
         #check in our own DB
         self.db_session = Activity.createSession('try')
         user = Activity.getUser(self.db_session,user_name)
         if not user:
             return
         if not self.checkPassword(pswd, user['password']):
             return
         del user['password']
         return user
开发者ID:AgentKWang,项目名称:ProjectPlaningTool,代码行数:29,代码来源:dbauth.py

示例2: POST

# 需要导入模块: import Activity [as 别名]
# 或者: from Activity import createSession [as 别名]
 def POST(self):
     session = Activity.createSession('try')
     if user_session.get('user')['access_level']==0:
         data  = json.loads(web.data())
         Activity.userIdAdmin(session, data["userid"], data["username"], data["mail"])
         return
     return "Permission Denied"
开发者ID:AgentKWang,项目名称:ProjectPlaningTool,代码行数:9,代码来源:ActivityWebTry.py

示例3: GET

# 需要导入模块: import Activity [as 别名]
# 或者: from Activity import createSession [as 别名]
 def GET(self,params_str):
     params=params_str.split('/')
     session = Activity.createSession('try')
     name = params[0]
     lead = params[1]
     attr =params[2]
     Activity.addTeamJson(session, name, lead, attr)
开发者ID:AgentKWang,项目名称:ProjectPlaningTool,代码行数:9,代码来源:ActivityWebTry.py

示例4: getCostBreakdownJson

# 需要导入模块: import Activity [as 别名]
# 或者: from Activity import createSession [as 别名]
def getCostBreakdownJson(parent_id):
    session = Activity.createSession('try')
    costs = Activity.getChildCosts(session, parent_id)
    result = '{"costs": [\n'
    for i in range(len(costs)-1):
        result += '{"name": "' + str(costs[i][0]) + '", "cost": ' + str(costs[i][1]) +', "objectId": '+str(costs[i][2])+ '},\n'
    if len(costs)>0:
        result += '{"name": "' + str(costs[-1][0]) + '", "cost": ' + str(costs[-1][1]) +', "objectId": '+str(costs[-1][2])+ '}'
    result +=']}'
    return result
开发者ID:AgentKWang,项目名称:ProjectPlaningTool,代码行数:12,代码来源:WebProjectTracker.py

示例5: login

# 需要导入模块: import Activity [as 别名]
# 或者: from Activity import createSession [as 别名]
 def login(self, user):
     """
     Set the user as logged in.
     """
     record_time = str(datetime.utcnow())
     self.db_session = Activity.createSession('try')
     user = Activity.updateUser(self.db_session,user['objectId'], record_time)
     try:
         del user['password']
     except KeyError:
         pass
     self.session.user = user
     return
开发者ID:AgentKWang,项目名称:ProjectPlaningTool,代码行数:15,代码来源:dbauth.py

示例6: getActivityProgressInfo

# 需要导入模块: import Activity [as 别名]
# 或者: from Activity import createSession [as 别名]
def getActivityProgressInfo(activity):
    info = {"warning":False, "delaytime":0, "msg":"", "children":0, "delayed":0}
    session = Activity.createSession("try")
    if activity.activity_type == "Release" or activity.activity_type == "Feature":
        query_table = Activity.Activity
        filter_col = Activity.Activity.parent_id
        recursive_func = getActivityProgressInfo
    else:
        query_table = Activity.Assignment
        filter_col = Activity.Assignment.activity_id
        recursive_func = getTaskProgressInfo
    children = session.query(query_table).filter(filter_col == activity.objectId)
    for child in children:
        info["children"] += 1
        if json.loads(recursive_func(child))["warning"]: info["delayed"] += 1
    if info["delayed"] > 0: info["warning"] = True
    session.close()
    return json.dumps(info)
开发者ID:AgentKWang,项目名称:ProjectPlaningTool,代码行数:20,代码来源:WebProjectTracker.py


注:本文中的Activity.createSession方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。