Ejemplo n.º 1
0
def save(params):
    """
    写入db
    """
    try:
        videoinfo = VideoInfo(taskid=params["taskId"], callback=params["callBackUrl"], filepath=params["filePath"])
        videoinfo.save()
    except Exception, e:
        return str(e)
Ejemplo n.º 2
0
def save(request):
    '''
    写入db
    ''' 
    try:
        videoinfoform = VideoInfoForm(request.POST, request.FILES)
        if videoinfoform.is_valid():
            videoname = videoinfoform.cleaned_data['videoname']
            videotype = videoinfoform.cleaned_data['videotype']
            videofile = videoinfoform.cleaned_data['videofile']
            videoinfo = VideoInfo(videoname=videoname, videotype=videotype, videofile=videofile)
            videoinfo.save()
        else:
            return "not valid form"
    except Exception, e:
        return str(e)