Ejemplo n.º 1
0
def cloneWorkspace(workspace_id):

        published_workspace = get_object_or_404(PublishedWorkSpace, id=workspace_id)
        
        workspace = published_workspace.workspace
        
        packageCloner = PackageCloner()
        
        return packageCloner.clone_tuple(workspace)
Ejemplo n.º 2
0
 def read(self, request, workspace_id):
     published_workspace = get_object_or_404(PublishedWorkSpace, id=workspace_id)
     
     workspace = published_workspace.workspace
     
     packageCloner = PackageCloner()
     
     cloned_workspace = packageCloner.clone_tuple(workspace)
     
     return HttpResponse("{'result': 'ok', 'new_workspace_id': %s}" % (cloned_workspace.id), mimetype='application/json; charset=UTF-8')
Ejemplo n.º 3
0
    def read(self, request, workspace_id):
        published_workspace = get_object_or_404(PublishedWorkSpace,
                                                id=workspace_id)

        workspace = published_workspace.workspace

        packageCloner = PackageCloner()

        cloned_workspace = packageCloner.clone_tuple(workspace)

        return HttpResponse("{'result': 'ok', 'new_workspace_id': %s}" %
                            (cloned_workspace.id),
                            mimetype='application/json; charset=UTF-8')
Ejemplo n.º 4
0
 def read(self, request, workspace_id):
     workspace = get_object_or_404(WorkSpace, id=workspace_id)
     
     packageCloner = PackageCloner()
     
     cloned_workspace = packageCloner.clone_tuple(workspace)
     
     cloned_workspace.active=False
     cloned_workspace.save()
     
     published_workspace = PublishedWorkSpace(type='CLONED', workspace=cloned_workspace)
     published_workspace.save()
     
     return HttpResponse("{'result': 'ok', 'published_workspace_id': %s}" % (published_workspace.id), mimetype='application/json; charset=UTF-8')
Ejemplo n.º 5
0
def cloneWorkspace(workspace_id, user):

    published_workspace = get_object_or_404(PublishedWorkSpace, id=workspace_id)
    
    workspace = published_workspace.workspace
    
    packageCloner = PackageCloner()
    
    cloned_workspace = packageCloner.clone_tuple(workspace)
    
    cloned_workspace.creator = user
    
    cloned_workspace.save()
    
    return cloned_workspace
Ejemplo n.º 6
0
    def read(self, request, workspace_id):
        workspace = get_object_or_404(WorkSpace, id=workspace_id)

        packageCloner = PackageCloner()

        cloned_workspace = packageCloner.clone_tuple(workspace)

        cloned_workspace.active = False
        cloned_workspace.save()

        published_workspace = PublishedWorkSpace(type='CLONED',
                                                 workspace=cloned_workspace)
        published_workspace.save()

        return HttpResponse("{'result': 'ok', 'published_workspace_id': %s}" %
                            (published_workspace.id),
                            mimetype='application/json; charset=UTF-8')