示例#1
0
    def get_field(self, fid):

        if fid is None:
            raise ValueError("A FID must be specified")

        fid = str(fid).strip()
        if len(fid) == 0:
            raise ValueError("A FID must be specified")

        return Serializer.field_to_json(self.__project.get_field(fid))
示例#2
0
    def get_symbol_fields(self, sid, limit, offset):
        if sid is None:
            raise ValueError("A SID must be specified")

        sid = str(sid).strip()
        if len(sid) == 0:
            raise ValueError("A SID must be specified")

        return [
            Serializer.field_to_json(field)
            for field in self.__project.get_symbol_fields(
                sid=sid, limit=limit, offset=offset)
        ]
示例#3
0
    def add_field(self, name, did):
        if name is None:
            raise ValueError("A name must be specified")

        name = str(name).strip()
        if len(name) == 0:
            raise ValueError("A name must be specified")

        if did is None:
            raise ValueError("A DID must be specified")

        did = str(did).strip()
        if len(did) == 0:
            raise ValueError("A DID must be specified")

        x = Serializer.field_to_json(
            self.__project.create_field(name=name, did=did))
        return x
示例#4
0
 def get_fields(self, limit, offset):
     return [
         Serializer.field_to_json(field)
         for field in self.__project.get_fields(limit, offset)
     ]