Adding the Login/Group Role Node.

Also - includes:
* Added 'parent_id' in the 'generate_browser_node' function of the Nodes
  to allow them to move around the parents objects (specially through
  update/save functionality).

* Handles the issue related to adding the older object back to the
  collection (DataModel).

Author: Ashesh Vashi
Reviewed by: Neel Patel, and Akshay Joshi.
This commit is contained in:
Ashesh Vashi committed 2016-02-05 09:48:38 +05:30
1 parent 3ff77e9866
commit 91c0388a47
39 files changed
+2797 -19

No files matched your search

+6 -4
View File
@@ -53,7 +53,7 @@ class CollectionNodeModule(PgAdminModule, PGChildModule):
return scripts
def generate_browser_node(
self, node_id, label, icon, **kwargs
self, node_id, parent_id, label, icon, **kwargs
):
obj = {
"id": "%s/%s" % (self.node_type, node_id),
@@ -62,20 +62,22 @@ class CollectionNodeModule(PgAdminModule, PGChildModule):
"inode": self.node_inode,
"_type": self.node_type,
"_id": node_id,
"_pid": parent_id,
"module": 'pgadmin.node.%s' % self.node_type
}
for key in kwargs:
obj.setdefault(key, kwargs[key])
return obj
def generate_browser_collection_node(self, sid, **kwargs):
def generate_browser_collection_node(self, parent_id, **kwargs):
obj = {
"id": "coll-%s/%d" % (self.node_type, sid),
"id": "coll-%s/%d" % (self.node_type, parent_id),
"label": self.collection_label,
"icon": self.collection_icon,
"inode": True,
"_type": 'coll-%s' % (self.node_type),
"_id": sid,
"_id": parent_id,
"_pid": parent_id,
"module": 'pgadmin.node.%s' % self.node_type
}