Sort all nodes when loading.

This commit is contained in:
Dave Page 2016-03-16 10:31:20 +00:00
parent 2fb6ccf5b2
commit 41805d40b5
14 changed files with 21 additions and 15 deletions

View File

@ -96,7 +96,7 @@ class ServerGroupView(NodeView):
for sg in ServerGroup.query.filter_by( for sg in ServerGroup.query.filter_by(
user_id=current_user.id user_id=current_user.id
): ).order_by(name):
res.append({ res.append({
'id': sg.id, 'id': sg.id,
'name': sg.name 'name': sg.name

View File

@ -379,7 +379,7 @@ class ServerNode(PGChildNodeView):
""" """
servers = Server.query.filter_by( servers = Server.query.filter_by(
user_id=current_user.id, user_id=current_user.id,
servergroup_id=gid) servergroup_id=gid).order_by(name)
sg = ServerGroup.query.filter_by( sg = ServerGroup.query.filter_by(
user_id=current_user.id, user_id=current_user.id,
id=gid id=gid

View File

@ -1,3 +1,3 @@
SELECT e.oid, e.evtname AS name SELECT e.oid, e.evtname AS name
FROM pg_event_trigger e FROM pg_event_trigger e
ORDER BY e.evtname ORDER BY e.evtname

View File

@ -13,4 +13,4 @@ WHERE
( (
{{ CATALOGS.LIST('nsp') }} {{ CATALOGS.LIST('nsp') }}
) )
ORDER BY 1, nspname; ORDER BY 2;

View File

@ -13,4 +13,4 @@ WHERE
( (
{{ CATALOGS.LIST('nsp') }} {{ CATALOGS.LIST('nsp') }}
) )
ORDER BY 1, nspname; ORDER BY 2;

View File

@ -14,4 +14,4 @@ WHERE
( (
{{ CATALOGS.LIST('nsp') }} {{ CATALOGS.LIST('nsp') }}
) )
ORDER BY 1, nspname; ORDER BY 2;

View File

@ -14,4 +14,4 @@ WHERE
( (
{{ CATALOGS.LIST('nsp') }} {{ CATALOGS.LIST('nsp') }}
) )
ORDER BY 1, nspname; ORDER BY 2;

View File

@ -18,4 +18,4 @@ WHERE
NOT ( NOT (
{{ CATALOGS.LIST('nsp') }} {{ CATALOGS.LIST('nsp') }}
) )
ORDER BY 1, nspname; ORDER BY nspname;

View File

@ -18,4 +18,4 @@ WHERE
NOT ( NOT (
{{ CATALOGS.LIST('nsp') }} {{ CATALOGS.LIST('nsp') }}
) )
ORDER BY 1, nspname; ORDER BY nspname;

View File

@ -18,4 +18,4 @@ WHERE
NOT ( NOT (
{{ CATALOGS.LIST('nsp') }} {{ CATALOGS.LIST('nsp') }}
) )
ORDER BY 1, nspname; ORDER BY nspname;

View File

@ -18,4 +18,4 @@ WHERE
NOT ( NOT (
{{ CATALOGS.LIST('nsp') }} {{ CATALOGS.LIST('nsp') }}
) )
ORDER BY 1, nspname; ORDER BY nspname;

View File

@ -5,4 +5,6 @@ FROM
pg_database db pg_database db
LEFT OUTER JOIN pg_tablespace ta ON db.dattablespace = ta.oid{% if did %} LEFT OUTER JOIN pg_tablespace ta ON db.dattablespace = ta.oid{% if did %}
WHERE db.oid={{ did|qtLiteral }}::OID{% endif %}; WHERE db.oid={{ did|qtLiteral }}::OID{% endif %}
ORDER BY datname;

View File

@ -5,4 +5,6 @@ FROM
pg_database db pg_database db
LEFT OUTER JOIN pg_tablespace ta ON db.dattablespace = ta.oid{% if did %} LEFT OUTER JOIN pg_tablespace ta ON db.dattablespace = ta.oid{% if did %}
WHERE db.oid={{ did|qtLiteral }}::OID {% endif %}; WHERE db.oid={{ did|qtLiteral }}::OID {% endif %}
ORDER BY datname;

View File

@ -5,4 +5,6 @@ FROM
pg_database db pg_database db
LEFT OUTER JOIN pg_tablespace ta ON db.dattablespace = ta.oid{% if did %} LEFT OUTER JOIN pg_tablespace ta ON db.dattablespace = ta.oid{% if did %}
WHERE db.oid={{ did|qtLiteral }}::OID{% endif %}; WHERE db.oid={{ did|qtLiteral }}::OID{% endif %}
ORDER BY datname;