[pgAdmin4][Patch]: Dependecies/Dependents functionality

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: [pgAdmin4][Patch]: Dependecies/Dependents functionality
Date: 2016-02-19 10:17:02
Message-ID: CANxoLDcG1MNGJB4z+RcK_e3vNqOeh4akfL5vLwXe9PnEFKB1GQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi All

I have implemented the logic to show Dependencies/Dependents when user
click on browser nodes. Attached is the patch file, please review it and if
it looks good then please commit it.

I have also added this support in "Database" , "Tablespace" and "Role" as
this nodes are already been committed. Following is the information about
how to add the support in other nodes

*Add following lines of code in** <your module>.js*

- Add *hasDepends: true *in your file just like we have added *hasSQL*.

*Add following lines of code in <your module>.__init__.py*

"from pgadmin.browser.server_groups.servers.depends import
get_dependencies, get_dependents" to import the functions.

Implement the dependents and dependencies function like below. Pass the
appropriate node id and the name of the node to the functions
"get_dependents" and "get_dependencies"

@check_precondition
def dependents(self, gid, sid, did, lid):
"""
This function get the dependents and return ajax response
for the language node.

Args:
gid: Server Group ID
sid: Server ID
did: Database ID
lid: Language ID
"""
dependents_result = get_dependents(self.conn, lid, 'language')
return ajax_response(
response=dependents_result,
status=200
)

@check_precondition
def dependencies(self, gid, sid, did, lid):
"""
This function get the dependencies and return ajax response
for the language node.

Args:
gid: Server Group ID
sid: Server ID
did: Database ID
lid: Language ID
"""
dependencies_result = get_dependencies(self.conn, lid, 'language')
return ajax_response(
response=dependencies_result,
status=200
)

--
*Akshay Joshi*
*Principal Software Engineer *

*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*

Attachment Content-Type Size
Dependencies.patch application/octet-stream 44.2 KB

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Akshay Joshi 2016-02-19 10:48:17 Re: [pgAdmin4] [Patch]: Language Module
Previous Message Dave Page 2016-02-19 09:39:33 Re: Building a development version of pgadmin