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


Python Event.progress方法代码示例

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


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

示例1: create_event

# 需要导入模块: from events.models import Event [as 别名]
# 或者: from events.models.Event import progress [as 别名]
def create_event(request):
    if request.method == 'POST':
        event_name = request.POST.get('event_name', None)
        event_image = request.POST.get('event_image', None)
        start_date = request.POST.get('start_date', None)
        end_date = request.POST.get('end_date', None)
        due_date = request.POST.get('due_date', None)
        goal = request.POST.get('goal', None)
        progress = request.POST.get('progress', None)
        event_description = request.POST.get('event_description', None)
        location_street = request.POST.get('location_street', None)
        location_number = request.POST.get('location_number', None)
        location_suburb = request.POST.get('location_suburb', None)
        location_neighborhood = request.POST.get('location_neighborhood', None)
        location_zip_code = request.POST.get('location_zip_code', None)
        location_city = request.POST.get('location_city', None)
        minimum_attendance = request.POST.get('minimum_attendance', None)
        maximum_attendance = request.POST.get('maximum_attendance', None)
        category_name = request.POST.get('category_name', None)
        restriction_name = request.POST.get('restriction_name', None)
        restriction_description = request.POST.get('restriction_description', None)
        tier_name = request.POST.get('tier_name', None)
        tier_price = request.POST.get('tier_price', None)
        tier_description = request.POST.get('tier_description', None)
        if (event_name and
            event_image and
            start_date and
            end_date and
            due_date and
            goal and
            progress and
            event_description and
            location_street and
            location_number and
            location_suburb and
            location_neighborhood and
            location_zip_code and
            location_city and
            minimum_attendance and
            maximum_attendance and
            category_name and
            restriction_name and
            restriction_description and
            tier_name and
            tier_price and
            tier_description):
            event = Event()
            event.name = event_name
            event.event_image = event_image
            event.start_date = start_date
            event.end_date = end_date
            event.due_date = due_date
            event.goal = goal
            event.progress = progress
            event.description = event_description
            event.location_street = location_street
            event.location_number = location_number
            event.location_suburb = location_suburb
            event.location_neighborhood = location_neighborhood
            event.location_zip_code = location_zip_code
            event.location_city = location_city
            event.minimum_attendance = minimum_attendance
            event.maximum_attendance = maximum_attendance
            event.save()
            category = EventCategory()
            category.category_name = category_name
            category.save()
            restriction = Restriction()
            restriction.name = restriction_name
            restriction.description = restriction_description
            restriction.save()
            tier = EventTier()
            tier.event = event
            tier.name = tier_name
            tier.price = tier_price
            tier.description = tier_description
            tier.save()
            return redirect('/events')
    return render(request, 'events/create.html', {})
开发者ID:maumg1196,项目名称:Eventstarter,代码行数:81,代码来源:views.py


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