Beispiel #1
0
def creatUSSMNoPrev(hasChildNode, id, SSMModel):
    newChild = UserSecuritySelectionModel()
    newChild.hasChildNode = hasChildNode
    newChild.tgtWeight = 0.0
    newChild.currWeight = 0.0

    classification = ClassificationNames.objects.get(id=id)

    newChild.classificationName = classification
    newChild.ext_model_id = classification.id
    newChild.SSM = SecuritySelectionModels.objects.get(id=SSMModel)

    newChild.isSSMNameNode = False

    return newChild
Beispiel #2
0
def createUserSecuritySelectionModel(childOfPreviousNode, SSMModel):

    if isinstance(childOfPreviousNode, list)==True:
        childOfPreviousNode = childOfPreviousNode.pop()

        newChild = UserSecuritySelectionModel()

        newChild.hasChildNode = childOfPreviousNode['hasChildNode']

        newChild.tgtWeight = 0.0
        newChild.currWeight = 0.0

        classification = ClassificationNames.objects.get(classificationName=childOfPreviousNode['classificationName'])

        newChild.classificationName = classification
        newChild.ext_model_id = classification.id
        newChild.SSM = SecuritySelectionModels.objects.get(id=SSMModel)

        newChild.isSSMNameNode = False

    return newChild
Beispiel #3
0
from equity.models import SecuritySelectionModels, UserSecuritySelectionModel, ClassificationNames
Beispiel #4
0
from django.http import HttpResponse, Http404, JsonResponse