本文整理汇总了Python中models.Activity.detail_intro方法的典型用法代码示例。如果您正苦于以下问题:Python Activity.detail_intro方法的具体用法?Python Activity.detail_intro怎么用?Python Activity.detail_intro使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Activity
的用法示例。
在下文中一共展示了Activity.detail_intro方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createNewActivity
# 需要导入模块: from models import Activity [as 别名]
# 或者: from models.Activity import detail_intro [as 别名]
def createNewActivity(request):
title = request.POST['title']
host = request.POST['host']
undertake = request.POST['undertake']
time = request.POST['time']
area = request.POST['area']
place = request.POST['place']
tel = request.POST['tel']
email = request.POST['email']
brief = request.POST['brief']
detail = request.POST['detail']
number = int(request.POST['number'])
c_id = request.POST['c_id']
club = Club.objects.get(id=c_id)
today = str(date.today().year)+'-'+str(date.today().month)+'-'+str(date.today().day)
#basic information
information = activityInfo()
information.title = title
information.host = host
information.undertake = undertake
information.time = time
information.area = area
information.place = place
information.tel = tel
information.email = email
information.number = number
information.save()
#host club
host = hostClub()
host.HC_club = club
host.save()
#record
record = recordInfo()
record.save()
#create new activity
new_activity = Activity()
new_activity.information = information
new_activity.club = host
new_activity.school = club.school
new_activity.record = record
new_activity.brief_intro = brief
new_activity.detail_intro = detail
form = uploadFileForm(request.POST, request.FILES)
if form.is_valid():
new_activity.image = request.FILES['image']
new_activity.safe_file = request.FILES['safe_file']
new_activity.save()
createGlobalNews(club.id,new_activity.id,'3')
return HttpResponse('1')