コード例 #1
0
 def save_to_mongo(request):
     result = 0
     upload_file = request.FILES['avatar_file']
     if AccountService.validate_upload_file(upload_file):
         result = MongoDBService.save_file(upload_file, UCenterMongoFile)
     return result
コード例 #2
0
ファイル: ci_service.py プロジェクト: zzxworks/TeamVision
 def save_to_mongo(request):
     result = 0
     upload_file = request.FILES['service_file']
     if CIService.validate_upload_file(upload_file):
         result = MongoDBService.save_file(upload_file, CIServiceMongoFile)
     return result
コード例 #3
0
 def save_to_mongo(file, mongo_model):
     result = ["0", "文件大小不能超过10M"]
     if BusinessService.validate_upload_file(file, 10 * 1024 * 1024, None):
         mongo_id = MongoDBService.save_file(file, mongo_model)
         result[0] = mongo_id
     return result
コード例 #4
0
 def save_to_mongo(file, size, mongo_model):
     result = 0
     upload_file = file
     if UploadFileService.validate_upload_file(upload_file, size, None):
         result = MongoDBService.save_file(upload_file, mongo_model)
     return result