"IndexError: list index out of range" when I invoke the .save()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

"IndexError: list index out of range" when I invoke the .save()

IWilliams
onto = get_ontology("file://../Ontology/ontoUseCase.owl").load()

def createUCModel(projOwner, projectName):
    with onto:
        projectOwner=User.objects.get(username=projOwner)
        proj=projectOwner.project_set.get(projectName=projectName)
        usecases=proj.usecaseprofile_set.all()
        for useC in usecases:
            #create use case instances along with data and object properties            
            my_UseCase = onto.UseCase(useC.useCasename)
            my_UseCase.hasBoundary=[useC.useCaseBoundary]
            my_UseCase.hasPurpose=[useC.useCasePurpose]
            my_UseCase.hasInteraction=[useC.useCaseInteraction]
            my_UseCase.name=[useC.useCasename]

#calling the method
createUCModel("willi", "Marvel E-Store")

onto.save()

Reply | Threaded
Open this post in threaded view
|

Re: "IndexError: list index out of range" when I invoke the .save()

Jiba
Administrator
I need more information to identify the problem. What is the error traceback ? How can I reproduce the problem ? (your code example cannot be run without the ontology ontoUseCase.owl and the usecases).