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


Python Event.url方法代码示例

本文整理汇总了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
开发者ID:tsoulcie,项目名称:nuxeo.org,代码行数:18,代码来源:plugins.py

示例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
开发者ID:giovamo,项目名称:Sar,代码行数:19,代码来源:profile.py

示例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))
开发者ID:matepeter,项目名称:ffmff,代码行数:23,代码来源:views.py


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