當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。