本文整理汇总了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)
示例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>
''')