Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Add Application Field get and update #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions pypodio2/areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,35 @@ def list_in_space(self, space_id):
"""
return self.transport.GET(url='/app/space/%s/' % space_id)

def get_field(self, app_id, field_id):
"""
Returns all specifications for the given field

:param app_id: Application ID
:type app_id: str or int
:param space_id: Space ID
:type space_id: str or int

:return Python dict of JSON response with the apps that the given app depends on.
"""
return self.transport.GET(url='/app/%s/field/%s' % (app_id,field_id))

def update_field(self, app_id, field_id, attributes):
"""
Returns all specifications for the given field

:param app_id: Application ID
:type app_id: str or int
:param space_id: Space ID
:type space_id: str or int
:param attributes: Updated field information. see https://developers.podio.com/doc/applications/update-an-app-field-22356
:type attributes: json, can be created with json.load('{"label": "labelname",') if manual.

:return Python dict of JSON response with app revision number if successful
"""
attributes = json.dumps(attributes)
return self.transport.PUT(url='/app/%s/field/%s' % (app_id, field_id), body=attributes, type='application/json')


class Task(Area):
def get(self, **kwargs):
Expand Down