本文整理汇总了Python中models.Event.url方法的典型用法代码示例。如果您正苦于以下问题:Python Event.url方法的具体用法?Python Event.url怎么用?Python Event.url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Event
的用法示例。
在下文中一共展示了Event.url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_event
# 需要导入模块: from models import Event [as 别名]
# 或者: from models.Event import url [as 别名]
def make_event(self, entry):
event = Event()
event.type = self.type
event.title = entry.title
event.uid = entry.id
event.url = entry.link
event.created = time.mktime(entry.updated_parsed)
event.author = entry.get("author", "unknown")
if entry.has_key("content"):
event.content = entry.content[0].value
elif entry.has_key("summary"):
event.content = entry.summary
else:
event.content = ""
self.post_init(event, entry)
return event
示例2: save_imported_event
# 需要导入模块: from models import Event [as 别名]
# 或者: from models.Event import url [as 别名]
def save_imported_event(project_key, start_time, end_time, event_title, event_description, billed, event_url=None):
new_ev = Event(parent=project_key)
new_ev.title = event_title
new_ev.start_time = start_time
new_ev.end_time = end_time
total_seconds = (end_time - start_time).total_seconds()
new_ev.elapsed_time = int(total_seconds // 60)
new_ev.description = event_description
new_ev.billed = billed
if event_url:
new_ev.url = event_url
new_ev.put()
return
示例3: submit_event
# 需要导入模块: from models import Event [as 别名]
# 或者: from models.Event import url [as 别名]
def submit_event(request):
if request.method == 'POST':
if request.POST.has_key('abort'):
return HttpResponseRedirect('/')
form = EventForm(request.POST)
if form.is_valid():
event = Event()
event.name = form.cleaned_data['name']
event.desc = form.cleaned_data['desc']
event.url = form.cleaned_data['url']
event.date_start = form.cleaned_data['date_start']
event.date_end = form.cleaned_data['date_end']
event.published = False
event.submit_ip = request.META['REMOTE_ADDR']
event.save()
return HttpResponseRedirect('/events/submit/success/')
else:
form = EventForm()
return render_to_response('events/submit_event.html',
{'form': form}, context_instance=RequestContext(request))