Ejemplo n.º 1
0
Archivo: Task.py Proyecto: onetera/sp
def getNewName( shot_idx=None, **arg):
	
	outDic = {}    
	lastTask = Archive("Task").getValues("Task.Parent3 == %s,Task.TypeCode == %s,Task.Element == %s" % (shot_idx, arg["Task.TypeCode"], arg["Task.Element"] ) , "Name,Code",  orderString="Task.Code DESC" )	
	if lastTask:
		outDic["Name"] = Naming.increaseName( lastTask["Name"] )
	else:
		outDic["Name"] = Naming.ApplyWithQuery("Task.Name", shot_idx, baseArcv="Shot", **arg )
	
	return outDic["Name"]
Ejemplo n.º 2
0
Archivo: Take.py Proyecto: onetera/sp
def getInitFormData( task_idx=None ):
	""" 신규 Take 작성시 양식정보 채움 """
	
	formData = {}
	
	if ( task_idx != None ):
		taskData = Archive("Task").getValues(task_idx, "Task.TypeCode,Task.Element,Task.Parent3")
		formData["TypeCode"] = taskData["TypeCode"]
		formData["Element"] = taskData["Element"]
		formData["Parent3"] = taskData["Parent3"]
		
		#Find Last Version
		lastTake = Archive("Take").getValues(
			"Take.Parent3 == %s,Take.TypeCode == %s,Take.Element == %s" %( formData["Parent3"], formData["TypeCode"], formData["Element"] ),
			"Name,Code,Version,Content,ApprovalNote",
			"Take.Version DESC")
		
		if lastTake:
			formData["Name"] = Naming.increaseName( lastTake["Name"] )
			if lastTake["Version"] == 0 or lastTake["Version"] == None:
				formData["Version"] = 1
			else:
				formData["Version"] = int(lastTake["Version"]) + 1
			formData["PrevApprNote"] = lastTake["ApprovalNote"]
			formData["PrevContent"] = lastTake["Content"]
		else:
			formData["PrevApprNote"] = "냉무"
			formData["PrevContent"] = "냉무"
			formData["Version"] = 1
			
			arg2 = { "Take.TypeCode": formData["TypeCode"],
						"Take.Element": formData["Element"],
						"Take.Version" : formData["Version"] }
			
			formData["Name"] = getNewName( task_idx, **arg2) 
			#outDic["Name"] = getNewName(taskIdx=taskIdx, shotIdx=shotIdx, taskCode=taskCode, elementName=elementName)
	
	return formData