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


Python Activity类代码示例

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


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

示例1: GET

 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,代码行数:7,代码来源:ActivityWebTry.py

示例2: authenticate

 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,代码行数:27,代码来源:dbauth.py

示例3: POST

 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,代码行数:7,代码来源:ActivityWebTry.py

示例4: GetSupportTasksByTeam

def GetSupportTasksByTeam(session, teamname):
    result =  '{"supports": [\n'
    supports = list(session.query(Activity.Assignment).filter(Activity.Assignment.team==teamname).filter(Activity.Assignment.task_phase>=100))
    for i in range(len(supports)-1):
        result+= supports[i].json()[:-1]+',"display_name":"'+Activity.getDisplaynameByUsername(session, supports[i].person)+ '"},\n'
    if len(supports)>0:
        result+= supports[-1].json()[:-1]+',"display_name":"'+Activity.getDisplaynameByUsername(session, supports[-1].person)+ '"}\n'
    result+=']}'
    return result
开发者ID:AgentKWang,项目名称:ProjectPlaningTool,代码行数:9,代码来源:SupportTasks.py

示例5: getCostBreakdownJson

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,代码行数:10,代码来源:WebProjectTracker.py

示例6: login

 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,代码行数:13,代码来源:dbauth.py

示例7: EditSupportTask

def EditSupportTask(session, id, st):
    task = list(session.query(Activity.Assignment).filter(Activity.Assignment.objectId == id))[0]
    task.person = st["person"]
    task.task_phase = st["type"]
    task.planned_start_date = st["start_date"]
    task.planned_num_weeks = st["duration"]
    task.forecast_end_date = Activity.getEndDate(st['start_date'], float(st["duration"]))
    task.activity_id = st["activity_id"]
    task.work_load = st["workload"]
    session.commit()
开发者ID:AgentKWang,项目名称:ProjectPlaningTool,代码行数:10,代码来源:SupportTasks.py

示例8: AddSupportTask

def AddSupportTask(session, st):
    if st["duration"]=='':
        durationCount = 0
        expectedEnd = ''
    else: 
        durationCount = st["duration"]
        expectedEnd = Activity.getEndDate(st['start_date'], float(st["duration"]))
    if st["type"]=="300":
        setname = st["person"]+" On Vacation"
    elif st["type"] == "301":
        setname = "Other"
    else:
        setname = st["team"] +":"+st["person"] + " Support Task"
    task = Activity.Assignment(name = setname, team = st["team"], activity_id = st["activity_id"],person = st["person"], task_phase = st["type"],\
                               planned_start_date = st["start_date"],planned_num_weeks = durationCount, work_load=st["workload"], forecast_start_date='',\
                               forecast_end_date = expectedEnd,actual_start_date='', actual_end_date='', status = 0, predecessor="[]", successor="[]",description='')
    session.add(task)
    session.commit()
开发者ID:AgentKWang,项目名称:ProjectPlaningTool,代码行数:18,代码来源:SupportTasks.py

示例9: getActivityProgressInfo

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,代码行数:18,代码来源:WebProjectTracker.py


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