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


Python Directory.get_meetings方法代码示例

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


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

示例1: send_content

# 需要导入模块: import Directory [as 别名]
# 或者: from Directory import get_meetings [as 别名]
  def send_content(self, request):
    '''Main loop for this view'''
    # get the meetings this user is in
    if request.session.user.superuser == '1':
      #the superuser gets sent straight to the Administrator page
      #pm_meetings = Directory.get_meetings()
      #meetings = []
      self.forward_to_superuser(request)

    
    else:
      pm_meetings = []
      meetings = []
      for meeting in Directory.get_meetings():               
        if Directory.get_group(meeting.id, request.session.user.id) != None:
          if self.user_is_pm(meeting, request.session.user.id):
            pm_meetings.append(meeting)
          else:
            meetings.append(meeting)
    
      # send to the appropriate page
      if len(meetings)+len(pm_meetings) == 0: #and request.session.user.superuser != '1': #superuser is now redirected before this line
        self.no_meetings(request)
      
      elif len(meetings)+len(pm_meetings) == 1: #and request.session.user.superuser != '1': #superuser is now redirected before this line
        if len(meetings) == 1:
          self.forward_to_meeting(request, meetings[0])
        else:
          #self.forward_to_meeting(request, pm_meetings[0])
	  self.forward_to_pm(request, pm_meetings[0])
      
      else:
        self.show_meetings(request, meetings, pm_meetings)
开发者ID:ssaltzman,项目名称:POET,代码行数:35,代码来源:MeetingChooser.py

示例2: meetings_page

# 需要导入模块: import Directory [as 别名]
# 或者: from Directory import get_meetings [as 别名]
  def meetings_page(self, request):
    '''Shows the meetings (embedded in the main page table)'''
    request.writeln('<div class="module"><h1>Programs</h1>')
    
    # current meetings
    request.writeln('''
      <div align="center" name="meetingselect" id="meetingselect">
	<div id="meetinglist">
    ''')
    
    meetings = Directory.get_meetings()
    meetings.sort(lambda a,b: cmp(a.name, b.name))
    for meeting in meetings:
      request.writeln('''<div class="progBox">
			<span style="display:none;" id="meetinginfo_''' + meeting.id + '''">''' + str(meeting.id) + '''/''' + meeting.view + '''/''' + meeting.name + '''</span>
			<span style="float:left;">'''+meeting.name+'''</span>
			<span style="float:right;">
			  <a class="ui-icon ui-icon-pencil" href='javascript:editMeeting("''' + meeting.id + '''");'></a>
			  <a class="ui-icon ui-icon-closethick" href='javascript:deleteMeeting("''' + meeting.id + '''");'></a>
			  <a class="ui-icon ui-icon-plusthick" href='javascript:renameMeeting("''' + meeting.id + '''");'></a>
			</span>
		      </div>
    ''')
    request.writeln('''</div><br/>
	  <center>
	    <div id="programFormDialog" style="display:none;" title="Create New Program">
	    ''' + request.cgi_form(_adminaction='newmeeting', meetingname=None, meetingview=None, meetingusers=None, name='npForm') + '''
	      <select style="display:none;" name="meetingview"><option value="poet">POET Acquisition Collaboration</option></select>
	      <table border=0 style="height:100%;padding:10px;">
		<tr>
		  <td>Name:</td><td><input type="text" name="meetingname" size="20" /></td>
		</tr>
		<tr>
		  <td>Users:</td><td><select name="meetingusers" multiple size="5">
    ''')
    users = Directory.get_users()
    users.sort(lambda a,b: cmp(a.username, b.username))
    for user in users:
	request.writeln('''<option id="'''+ user.id + '''">''' + user.name + '''</option>''')
    request.writeln('''
		  </select></td>
		</tr>
		<tr>
		  <td><input type="submit" id="newProgram" value="Create" onclick="document.npForm.submit();" /></td><td><input type="button" id="cancelNP" value="Cancel" /></td>
		</tr>
	      </table>
	      </form>
	    </div>
	    <input type="button" id="createNP" value="Create New Program"></input>	  
	  </center>
	</div>
      </div>
    ''')
开发者ID:ssaltzman,项目名称:POET,代码行数:55,代码来源:Administrator.py


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