0004-api-include-a-geolocation-part-in-formdef-schemas-10.patch
wcs/formdef.py | ||
---|---|---|
91 | 91 |
# a single point is hardcoded for now, it will be changed into an actual |
92 | 92 |
# formdef parameter whenever the need for several points per formdata |
93 | 93 |
# arises. |
94 |
geolocations = {'base': ''} |
|
94 |
geolocations = {'base': 'Base'}
|
|
95 | 95 | |
96 | 96 |
last_modification_time = None |
97 | 97 |
last_modification_user_id = None |
... | ... | |
555 | 555 |
for field in self.fields: |
556 | 556 |
root['fields'].append(field.export_to_json(include_id=include_id)) |
557 | 557 | |
558 |
if self.workflow and [x for x in self.workflow.get_all_actions() if x.key == 'geolocate']: |
|
559 |
root['geolocation'] = self.geolocations.copy() |
|
560 | ||
558 | 561 |
if self.workflow_options: |
559 | 562 |
root['options'] = self.workflow_options |
560 | 563 |
wcs/workflows.py | ||
---|---|---|
369 | 369 |
break |
370 | 370 |
return actions |
371 | 371 | |
372 |
def get_all_actions(self): |
|
373 |
items = [] |
|
374 |
for status in self.possible_status or []: |
|
375 |
items.extend(status.items) |
|
376 |
for action in self.global_actions or []: |
|
377 |
items.extend(action.items) |
|
378 |
return items |
|
379 | ||
372 | 380 |
def __setstate__(self, dict): |
373 | 381 |
self.__dict__.update(dict) |
374 | 382 |
for s in self.possible_status + (self.global_actions or []): |
375 |
- |