diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/__init__.py
index 11180ad85..72dbb5d24 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/__init__.py
@@ -200,52 +200,27 @@ class PartitionsView(BaseTableView, DataTypeReader, VacuumSettings):
})
- def children(self, **kwargs):
- """Build a list of treeview nodes from the child nodes."""
-
- if 'sid' not in kwargs:
- return precondition_required(
- gettext('Required properties are missing.')
- )
-
- from pgadmin.utils.driver import get_driver
- manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(
- sid=kwargs['sid']
- )
-
- did = None
- if 'did' in kwargs:
- did = kwargs['did']
-
- conn = manager.connection(did=did)
-
- if not conn.connected():
- return precondition_required(
- gettext(
- "Connection to the server has been lost."
- )
- )
-
+ def _get_children_nodes(self, manager, **kwargs):
nodes = []
+ # treat partition table as normal table.
+ # replace tid with ptid and pop ptid from kwargs
+ if 'ptid' in kwargs:
+ ptid = kwargs.pop('ptid')
+ kwargs['tid'] = ptid
+
for module in self.blueprint.submodules:
if isinstance(module, PGChildModule):
if manager is not None and \
module.BackendSupported(manager, **kwargs):
- # treat partition table as normal table.
- # replace tid with ptid and pop ptid from kwargs
- if 'ptid' in kwargs:
- ptid = kwargs.pop('ptid')
- kwargs['tid'] = ptid
nodes.extend(module.get_nodes(**kwargs))
else:
nodes.extend(module.get_nodes(**kwargs))
- # Return sorted nodes based on label
- return make_json_response(
- data=sorted(
- nodes, key=lambda c: c['label']
- )
- )
+ if manager is not None and \
+ self.blueprint.BackendSupported(manager, **kwargs):
+ nodes.extend(self.blueprint.get_nodes(**kwargs))
+
+ return nodes
@BaseTableView.check_precondition
def list(self, gid, sid, did, scid, tid):
@@ -295,7 +270,7 @@ class PartitionsView(BaseTableView, DataTypeReader, VacuumSettings):
"""
SQL = render_template(
"/".join([self.partition_template_path, 'nodes.sql']),
- scid=scid, tid=tid
+ scid=scid, tid=tid, ptid=ptid
)
status, rset = self.conn.execute_2darray(SQL)
if not status:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
index 14e015210..04a693ead 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
@@ -49,8 +49,7 @@ function(
sqlCreateHelp: 'sql-createtable.html',
dialogHelp: url_for('help.static', {'filename': 'table_dialog.html'}),
hasScriptTypes: ['create'],
- height: '95%',
- width: '85%',
+ width: '650px',
Init: function() {
/* Avoid mulitple registration of menus */
if (this.initialized)
@@ -865,7 +864,7 @@ function(
canEdit: false, canDelete: true,
customDeleteTitle: gettext('Detach Partition'),
customDeleteMsg: gettext('Are you sure you wish to detach this partition?'),
- columns:['is_attach', 'partition_name', 'values_from', 'values_to', 'values_in'],
+ columns:['is_attach', 'partition_name', 'is_default', 'values_from', 'values_to', 'values_in', 'values_modulus', 'values_remainder'],
control: Backform.SubNodeCollectionControl.extend({
row: Backgrid.PartitionRow,
initialize: function() {
@@ -930,10 +929,30 @@ function(
},{
id: 'partition_note', label: gettext('Partition'),
type: 'note', group: 'partition',
- text: gettext('The control above is used to Create/Attach/Detach partitions.
' +
- '