1414FRD_WORK_LIST = "https://www.freud-edition.net/jsonapi/node/werk?filter[field_status_umschrift]=2"
1515FRD_USER = os .environ .get ('FRD_USER' , False )
1616FRD_PW = os .environ .get ('FRD_PW' , False )
17+ FULL_MANIFEST = "228361d0-4cda-4805-a2f8-a05ee58119b6"
1718
1819
1920def get_auth_items (username , password ):
@@ -145,7 +146,7 @@ def get_werk(self):
145146 """ returns the werk json as python dict
146147
147148 :return: a Werk representation
148- :rtrype : dict
149+ :rtype : dict
149150 """
150151 r = requests .get (
151152 self .ep ,
@@ -155,9 +156,20 @@ def get_werk(self):
155156 result = r .json ()
156157 return result
157158
158- def get_manifestations (self ):
159+ def get_manifestations (self , field_doc_component = None ):
160+ """ retuns a list of dicts of related manifestation
161+ :param field_doc_component: Either `None` or the id of the taxanomy-term id
162+ :type werk_id: str/bool
163+
164+ :return: A list of dicts with ids and titles of the related manifestations
165+ :rtype: list
166+ """
159167 man_col = []
160- url = f"{ self .manifestation_ep } { self .filtered_url } &fields[node--manifestation]=id,title"
168+ fields_param = "fields[node--manifestation]=id,title"
169+ if field_doc_component is not None :
170+ url = f"{ self .manifestation_ep } { self .filtered_url } &{ fields_param } &filter[field_doc_component.id]={ field_doc_component } " # noqa: E501
171+ else :
172+ url = f"{ self .manifestation_ep } { self .filtered_url } &{ fields_param } "
161173 next_page = True
162174 while next_page :
163175 print (url )
0 commit comments