pgAdmin 4 commit: Introduced a class - NodeView to achieve REST API req
От | Ashesh Vashi |
---|---|
Тема | pgAdmin 4 commit: Introduced a class - NodeView to achieve REST API req |
Дата | |
Msg-id | E1Z9oYM-0004za-5k@gothos.postgresql.org обсуждение исходный текст |
Список | pgadmin-hackers |
Introduced a class - NodeView to achieve REST API required by the PostgreSQL node(s). Browser Tree Node (PostgreSQL object) requires more than just CRUD. i.e. - CRUD (Create, Read, Update & Delete) - Reversed Engineered SQL for the object - Modified Query in edit mode i.e. ALTER TABLE ... - Statistics - List of dependents - List of dependencies - Children node list This class can be inherited to achieve the different routes for each of the object types/collections. OPERATION | URL | Method ---------------+------------------------+-------- List | /obj/[Parent URL]/ | GET Properties | /obj/[Parent URL]/id | GET Create | /obj/[Parent URL]/ | POST Delete | /obj/[Parent URL]/id | DELETE Update | /obj/[Parent URL]/id | PUT SQL (Reversed | /sql/[Parent URL]/id | GET Engineering) | SQL (Modified | /sql/[Parent URL]/id | POST Properties) | Statistics | /stats/[Parent URL]/id | GET Dependencies | /deps/[Parent URL]/id | GET Dependents | /deps/[Parent URL]/id | POST Children Nodes | /nodes/[Parent URL]/id | GET NOTE: Parent URL can be seen as the path to identify the particular node. i.e. In order to identify the TABLE object, we requires information about the server -> database -> schema objects. Hence, the Parent URL for the TABLE object will be something like this as below: <int:sid>/<str:database>/<str:schema> Inherited a new classes ServerGroupView and ServerView, which are inherited from the NodeView for the implementation of above operations. Branch ------ master Details ------- http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=35d01bea3ebda80f0e52e55446b34e3950452986 Modified Files -------------- web/pgAdmin4.py | 4 +- web/pgadmin/browser/__init__.py | 37 ++- web/pgadmin/browser/server_groups/__init__.py | 225 +++++++++------ .../browser/server_groups/servers/__init__.py | 301 ++++++++++++++------ .../servers/templates/servers/servers.js | 32 ++- .../templates/server_groups/server_groups.js | 23 +- web/pgadmin/browser/templates/browser/css/node.css | 2 +- .../browser/templates/browser/js/browser.js | 6 + web/pgadmin/browser/utils.py | 212 +++++++++++--- web/pgadmin/settings/settings_model.py | 26 +- web/pgadmin/templates/base.html | 24 +- web/setup.py | 13 + 12 files changed, 624 insertions(+), 281 deletions(-)
В списке pgadmin-hackers по дате отправления: