(self, request)
return [gobj]
Expose the objects generated in the Relationships Service via an API.

        :param request: The incoming request.
        :type request: :class:`django.http.HttpRequest`
        :returns: Resulting objects in the specified format (JSON by default).
Expose the objects generated in the Relationships Service via an API.
Expose the objects generated in the Relationships Service via an API .
def get_object_list(self, request):
        """
        Expose the objects generated in the Relationships Service via an API.

        :param request: The incoming request.
        :type request: :class:`django.http.HttpRequest`
        :returns: Resulting objects in the specified format (JSON by default).
        """

        ctype = request.GET.get('ctype', None)
        cid = request.GET.get('cid', None)
        depth = request.GET.get('depth', 3)
        types = request.GET.get('types', '')

        # If the user specifies no types, be generous.
        if types:
            types = types.split(',')
        else:
            types = settings.CRITS_TYPES.keys()

        if not ctype:
            raise BadRequest("Must specify CRITs type (ctype).")
        if not cid:
            raise BadRequest("Must specify CRITs id (cid).")

        username = request.user.username
        rels = handlers.gather_relationships(ctype, cid, username, depth, types)
        gobj = GraphObject()
        gobj.nodes = rels['nodes']
        gobj.links = rels['links']
        return [gobj]
def get_object_list ( self , request ) : ctype = request . GET . get ( 'ctype' , None ) cid = request . GET . get ( 'cid' , None ) depth = request . GET . get ( 'depth' , 3 ) types = request . GET . get ( 'types' , '' ) # If the user specifies no types, be generous. if types : types = types . split ( ',' ) else : types = settings . CRITS_TYPES . keys ( ) if not ctype : raise BadRequest ( "Must specify CRITs type (ctype)." ) if not cid : raise BadRequest ( "Must specify CRITs id (cid)." ) username = request . user . username rels = handlers . gather_relationships ( ctype , cid , username , depth , types ) gobj = GraphObject ( ) gobj . nodes = rels [ 'nodes' ] gobj . links = rels [ 'links' ] return [ gobj ]