Re: [pgadmin-hackers] Control for selecting multiple columns [pgadmin4]

2016-03-15 Thread Dave Page
It seems to be missing the test dialogue?

On Tue, Mar 15, 2016 at 8:47 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA generalized updated patch for backform multiSelectControl.
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB 
>
> On Tue, Mar 8, 2016 at 1:04 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA backform control for selecting multiple columns.(This control depends
>> on column node.)
>>
>> Usage:
>>
>> {
>>   id: 'columns', label: '{{ _('Columns') }}',
>>   type: 'collection', group: '{{ _('Definition') }}', editable:true,
>>   canDelete: true, canAdd: true, control: Backform.MultiColumnSelectControl,
>>   deps: ['index'], node: 'column',
>>   model: pgBrowser.Node.Model.extend({
>> keys: ['column'],
>> defaults: {
>>   column: undefined
>> }
>>   })
>> }
>>
>>
>> Note: When using this control model should have *column* attribute. And
>> node property should be *column*.
>>
>>
>>
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer *
>>
>>
>>
>> EenterpriseDB 
>>
>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin-hackers] depends.js and sql.js

2016-03-15 Thread Dave Page
On Tue, Mar 15, 2016 at 4:01 PM, Ashesh Vashi  wrote:

> On Tue, Mar 15, 2016 at 9:22 PM, Dave Page  wrote:
>
>> Hi Ashesh,
>>
>> Any reason the above files are in static directories? Both have
>> strings in them that should be translated.
>>
> When it was implemented initially, I was not in mood to keep the
> translation message in individual file.
> And, as it does not have any other dynamic data, we kept it in static
> directory.
>
> Then - we added the messages later.
> I am thinking to create a common javascript, which can keep translatable
> messages in at centre location for tightly couple modules.
> We're currently using those type of messages in pgBrowser.messages object.
>

That's a good idea. Minimise the number of templates to process.


>
> FYI, I'm not overly sure what needs to be done to move them these days
>> - I haven't looked into the require code at all.
>>
> We need to put the javascript, when there is some dynamic code needs to be
> generated, then we should put it in templates, and rest should go in static
> directory.
>

I look forward to seeing your patch :-)

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgadmin-hackers] depends.js and sql.js

2016-03-15 Thread Ashesh Vashi
On Tue, Mar 15, 2016 at 9:22 PM, Dave Page  wrote:

> Hi Ashesh,
>
> Any reason the above files are in static directories? Both have
> strings in them that should be translated.
>
When it was implemented initially, I was not in mood to keep the
translation message in individual file.
And, as it does not have any other dynamic data, we kept it in static
directory.

Then - we added the messages later.
I am thinking to create a common javascript, which can keep translatable
messages in at centre location for tightly couple modules.
We're currently using those type of messages in pgBrowser.messages object.

FYI, I'm not overly sure what needs to be done to move them these days
> - I haven't looked into the require code at all.
>
We need to put the javascript, when there is some dynamic code needs to be
generated, then we should put it in templates, and rest should go in static
directory.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] pgAdmin 4 commit: Resolved an issue related to no proper valid/invalid

2016-03-15 Thread Ashesh Vashi
On Tue, Mar 15, 2016 at 8:32 PM, Dave Page  wrote:

> It looks like this has broken the schema properties dialog. On opening
> it, I now get:
>
> Uncaught TypeError: Cannot read property 'server' of
>
> undefinedpgNode.PrivilegeRoleModel.pgNode.Model.extend.schema.cell.Backgrid.Extension.NodeListByNameCell.extend.omit_selected_roles
> @
> privilege.js:144Backgrid.Extension.NodeAjaxOptionsCell.Backgrid.Extension.Select2Cell.extend.render
> @ node.ui.js:404Backgrid.Row.Backbone.View.extend.render @
> backgrid.js:1954Backgrid.Body.Backbone.View.extend.render @
> backgrid.js:2459Backgrid.Grid.Backbone.View.extend.render @
>
> backgrid.js:2860Backform.UniqueColCollectionControl.Backform.Control.extend.showGridControl
> @
> backform.pgadmin.js:986Backform.UniqueColCollectionControl.Backform.Control.extend.render
> @ backform.pgadmin.js:923(anonymous function) @
> backform.pgadmin.js:547_.each._.forEach @
> underscore.js:153Collection.(anonymous function) @
> backbone.js:966(anonymous function) @
> backform.pgadmin.js:540_.each._.forEach @
> underscore.js:153Backform.Dialog.Backform.Form.extend.render @
> backform.pgadmin.js:530(anonymous function) @ node.js:201fire @
> jquery-1.11.2.js:3143self.fireWith @ jquery-1.11.2.js:3255done @
> jquery-1.11.2.js:9309callback @ jquery-1.11.2.js:9713
>
Thanks for reporting.
It could have happened to all the nodes having privilege control, with
existing privileges in an object.

I was relying on the individual model to fetch the tree hierarchy
information, which was not available in case when we have existing
privileges information in earlier implementation.
Instead now, we rely on the top level model to fetch that information.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


>
> On Tue, Mar 15, 2016 at 1:38 PM, Ashesh Vashi
>  wrote:
> > Resolved an issue related to no proper valid/invalid event was
> > generated for the privilege control. Also, made changes in the
> > PrivilegeRoleModel, to allow to select a grantee only once for the
> > current user (as grantor), and omit them from other cell objects.
> >
> > Valid/Invalid event was not properly triggered, whenever the child
> > attribute is a collection/model within a model (nested mode/collection
> > within model). This patch tried to take care of all such scenarios in
> > general.
> >
> > Branch
> > --
> > master
> >
> > Details
> > ---
> >
> http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4adea4dc2596fb495c4df8129745b87c35b062a6
> >
> > Modified Files
> > --
> > .../server_groups/servers/static/js/privilege.js   | 187
> ++---
> > .../servers/templates/servers/servers.js   |   9 +-
> > web/pgadmin/browser/static/js/datamodel.js | 233
> ++---
> > 3 files changed, 283 insertions(+), 146 deletions(-)
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgadmin-hackers
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


[pgadmin-hackers] depends.js and sql.js

2016-03-15 Thread Dave Page
Hi Ashesh,

Any reason the above files are in static directories? Both have
strings in them that should be translated.

FYI, I'm not overly sure what needs to be done to move them these days
- I haven't looked into the require code at all.

Thanks.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Do not rely on the individual model (instead use the

2016-03-15 Thread Ashesh Vashi
Do not rely on the individual model (instead use the first level 'top'
model) to fetch the node_info, because - when loading the data in the
collection, it may not initialize all the parameters.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=40ceabb0824330171f5a43e9737fffb17b6690db

Modified Files
--
web/pgadmin/browser/server_groups/servers/static/js/privilege.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Improve message display.

2016-03-15 Thread Dave Page
Improve message display.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=62bd1a21cc926049fa7c8c2e4ad464e487ff3c27

Modified Files
--
web/pgadmin/browser/templates/browser/js/browser.js |  6 +++---
web/pgadmin/browser/templates/browser/js/node.js| 14 +++---
web/pgadmin/misc/depends/static/js/depends.js   |  8 
web/pgadmin/misc/sql/static/js/sql.js   |  4 ++--
web/pgadmin/static/css/overrides.css|  9 +
5 files changed, 25 insertions(+), 16 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Fix security label sizing.

2016-03-15 Thread Dave Page
Fix security label sizing.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=c81469832871a8837225e12cecc8bcb349350637
Author: Arun Kollan 

Modified Files
--
.../servers/databases/languages/templates/languages/js/languages.js | 6 --
.../databases/schemas/sequences/templates/sequence/js/sequence.js   | 6 --
.../servers/databases/schemas/templates/catalog/js/catalog.js   | 6 --
.../servers/databases/schemas/templates/schema/js/schema.js | 6 --
.../browser/server_groups/servers/roles/templates/role/js/role.js   | 6 --
.../servers/tablespaces/templates/tablespaces/js/tablespaces.js | 6 --
6 files changed, 24 insertions(+), 12 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] pgAdmin 4 commit: Resolved an issue related to no proper valid/invalid

2016-03-15 Thread Dave Page
It looks like this has broken the schema properties dialog. On opening
it, I now get:

Uncaught TypeError: Cannot read property 'server' of
undefinedpgNode.PrivilegeRoleModel.pgNode.Model.extend.schema.cell.Backgrid.Extension.NodeListByNameCell.extend.omit_selected_roles
@ 
privilege.js:144Backgrid.Extension.NodeAjaxOptionsCell.Backgrid.Extension.Select2Cell.extend.render
@ node.ui.js:404Backgrid.Row.Backbone.View.extend.render @
backgrid.js:1954Backgrid.Body.Backbone.View.extend.render @
backgrid.js:2459Backgrid.Grid.Backbone.View.extend.render @
backgrid.js:2860Backform.UniqueColCollectionControl.Backform.Control.extend.showGridControl
@ 
backform.pgadmin.js:986Backform.UniqueColCollectionControl.Backform.Control.extend.render
@ backform.pgadmin.js:923(anonymous function) @
backform.pgadmin.js:547_.each._.forEach @
underscore.js:153Collection.(anonymous function) @
backbone.js:966(anonymous function) @
backform.pgadmin.js:540_.each._.forEach @
underscore.js:153Backform.Dialog.Backform.Form.extend.render @
backform.pgadmin.js:530(anonymous function) @ node.js:201fire @
jquery-1.11.2.js:3143self.fireWith @ jquery-1.11.2.js:3255done @
jquery-1.11.2.js:9309callback @ jquery-1.11.2.js:9713

On Tue, Mar 15, 2016 at 1:38 PM, Ashesh Vashi
 wrote:
> Resolved an issue related to no proper valid/invalid event was
> generated for the privilege control. Also, made changes in the
> PrivilegeRoleModel, to allow to select a grantee only once for the
> current user (as grantor), and omit them from other cell objects.
>
> Valid/Invalid event was not properly triggered, whenever the child
> attribute is a collection/model within a model (nested mode/collection
> within model). This patch tried to take care of all such scenarios in
> general.
>
> Branch
> --
> master
>
> Details
> ---
> http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4adea4dc2596fb495c4df8129745b87c35b062a6
>
> Modified Files
> --
> .../server_groups/servers/static/js/privilege.js   | 187 ++---
> .../servers/templates/servers/servers.js   |   9 +-
> web/pgadmin/browser/static/js/datamodel.js | 233 ++---
> 3 files changed, 283 insertions(+), 146 deletions(-)
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Fixed issue related to 'show_system_objects' in dependencies/dependents

2016-03-15 Thread Dave Page
Thanks, committed.

On Mon, Mar 14, 2016 at 10:56 AM, Akshay Joshi <
akshay.jo...@enterprisedb.com> wrote:

> Hi All
>
> As 'show_system_objects' has been implemented, I have fixed an issue for
> dependencies/dependents. With previous implementation each node will have
> to send the values of 'show_system_objects' while calling
> get_dependencies/get_dependents function. Now I have changed the logic to
> use the value directly into the base class functions.
>
> Attached is the patch file. Please review it and if it looks good then
> please commit it.
>
> --
> *Akshay Joshi*
> *Principal Software Engineer *
>
>
>
> *Phone: +91 20-3058-9517 <%2B91%2020-3058-9517>Mobile: +91 976-788-8246*
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


[pgadmin-hackers] pgAdmin 4 commit: As 'show_system_objects' has been implemented, I have

2016-03-15 Thread Dave Page
As 'show_system_objects' has been implemented, I have fixed an issue for 
dependencies/dependents.
With previous implementation each node will have to send the values of 
'show_system_objects'
while calling get_dependencies/get_dependents function. Now I have changed the 
logic to use the
value directly into the base class functions.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=218cc3ec0c553f91a2fdc9262f00bbd9604af051
Author: Akshay Joshi 

Modified Files
--
web/pgadmin/browser/utils.py | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Reduce column header letter spacing a touch.

2016-03-15 Thread Dave Page
Reduce column header letter spacing a touch.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=2711d3492d955bfccc8f1c8b9392a91c67aae429

Modified Files
--
web/pgadmin/static/css/overrides.css | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Resolved an issue related to no proper valid/invalid

2016-03-15 Thread Ashesh Vashi
Resolved an issue related to no proper valid/invalid event was
generated for the privilege control. Also, made changes in the
PrivilegeRoleModel, to allow to select a grantee only once for the
current user (as grantor), and omit them from other cell objects.

Valid/Invalid event was not properly triggered, whenever the child
attribute is a collection/model within a model (nested mode/collection
within model). This patch tried to take care of all such scenarios in
general.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4adea4dc2596fb495c4df8129745b87c35b062a6

Modified Files
--
.../server_groups/servers/static/js/privilege.js   | 187 ++---
.../servers/templates/servers/servers.js   |   9 +-
web/pgadmin/browser/static/js/datamodel.js | 233 ++---
3 files changed, 283 insertions(+), 146 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Improvements in the form/properties dialog control ge

2016-03-15 Thread Ashesh Vashi
Improvements in the form/properties dialog control generation, and data
change events.

- In input & textarea control, call the change event on key up (but -
  not on every key up events, wait for sometime before trigger that
  event, so that - we do not overdo that).
- In unique/subnode control, whenever we create new model object, set
  all the required static fields used by pgAdmin form generation logic.
- In NodeAjaxListCell, we don't need to call the list generation
  operation (ajax operation) for each and every cell. They use the same
  shared column object.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=b52a5736ff137f057f720e8ad18559f663bdb28f

Modified Files
--
web/pgadmin/browser/static/js/node.ui.js  | 44 ---
web/pgadmin/static/js/backform.pgadmin.js | 89 +++
2 files changed, 77 insertions(+), 56 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][psycopg2] - poll function local variable reference error

2016-03-15 Thread Dave Page
Thanks, applied.

On Tue, Mar 15, 2016 at 11:44 AM, Neel Patel
 wrote:
> Hi,
>
> During the debugger implementation, we came to know that "poll()" function
> is getting failed when the status is not equal to "ASYNC_OK". We are getting
> the below error at python side.
>
> "UnboundLocalError: local variable 'colinfo' referenced before assignment"
>
>
> Attached is the patch that resolves the above error.
>
> Do review it and let us know for comments.
>
> Thanks,
> Neel Patel
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Fix a bug in the database drive poll() function where

2016-03-15 Thread Dave Page
Fix a bug in the database drive poll() function where we could try to reference 
a non-existant variable.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=ff424850f803850a99f1b9eae3300a94e5fc685b
Author: Neel Patel 

Modified Files
--
web/pgadmin/utils/driver/psycopg2/__init__.py | 1 +
1 file changed, 1 insertion(+)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Subnode collection layout improvements, with addition

2016-03-15 Thread Dave Page
Subnode collection layout improvements, with additional tweaks from me.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=cdd7a1f6371f3837ed5447bfaf240e90eeba80a8
Author: Arun Kollan 

Modified Files
--
.../databases/templates/databases/js/databases.js  |   6 +-
.../server_groups/servers/static/js/privilege.js   |   4 +-
web/pgadmin/static/css/overrides.css   | 217 -
3 files changed, 133 insertions(+), 94 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] PIP Package Building for pgAdmin4

2016-03-15 Thread Dave Page
Hi

On Tue, Mar 15, 2016 at 6:23 AM, Muhammad Aqeel
 wrote:
> Hi Dave,
>
> On Mon, Mar 14, 2016 at 7:06 PM, Dave Page  wrote:
>>
>> Hi
>>
>> On Mon, Mar 14, 2016 at 1:46 PM, Muhammad Aqeel
>>  wrote:
>> > Hi Dave,
>> >
>> > I tested the build after your commit. There were minor bugs in your
>> > changes
>> > which prevented the packaging of pgadmin4 sources.
>> >
>> > - It needed a space after * in recursive include statement of
>> > manifest.in
>> > - \n is not interpreted as new line.
>> >
>> > I fixed both issues in attached patch and tested the build. It is
>> > working
>> > fine now and pgadmin4.egg-info/SOURCES.txt showing no .pyc file and
>> > pgadmin4.db file in it.
>>
>> Weird - as discussed, I tested it thoroughly before committing and it
>> works fine.
>
>
> PFA the new patch which contains following changes.
>
> - It just replaces the @echo to @printf in your changed line to fix the
> issue. I tested it on both Linux and OSX. It is working fine.

Looks good to me - committed.

> - In your commit you had changed 'PGADMIN_DIST = dist' to 'PGADMIN_DIST =
> build'. dist directory is generated by pip setuptools to have generated
> wheel file so it is needed. I made it again 'PGADMIN_DIST = dist'. If you
> don't want to remove it in clean-pip target then you can remove the rm
> command from clean-pip target.

Urgh. It might be nice if we can put all those directories in one
place, like pip-temp/ or something more sensible. Either way, it's no
big issue.

> - In case user runs make twice without cleaning the source it was copying
> the web directory to existing pgadmin4 source directory. I fixed this issue
> too.

OK, thanks.

>> Testing with this patch though, I see the original problem (and also,
>> so warnings - can you check them please)?
>>
>> (pgadmin4)piranha:pgAdmin4 dpage$ git reset --hard
>> HEAD is now at dc64160 Add a top level Makefile with a target and
>> appropriate Python stuff to build a PIP package of the web code.
>> (pgadmin4)piranha:pgAdmin4 dpage$ make pip 1> /dev/null
>>
>> /Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/setuptools/dist.py:285:
>> UserWarning: Normalizing '1.0.0-dev' to '1.0.0.dev0'
>>   normalized_version,
>
>
> It is an issue with PEP440 which interprets version as integer and if sees
> any string in it, it tries to normalise it. Here is the link which explains
> it.
>
> https://bitbucket.org/pypa/setuptools/issues/302/setuptools-8-strips-leading-zeros-in
>
> It is coming with Python 2.6 only. With Python 2.7 and above it is not
> there.

Weird - I have 2.7...

>> package init file 'pgadmin4/__init__.py' not found (or not a regular file)
>
>
> This is because in web directory we don't have __init__.py file.
>
>>
>> warning: manifest_maker: standard file 'setup_pip.py' not found
>
>
> setuptools by default look for setup_pip.py file in current directory. Since
> we placed this file in pkg/pip (according to your suggestion) this warning
> is coming.
>
>>
>>
>> warning: build_py: byte-compiling is disabled, skipping.
>>
>> warning: install_lib: byte-compiling is disabled, skipping.
>
>
> I have not faced this issue but following link suggests a solution for it.
>
> http://stackoverflow.com/questions/7194299/cannot-create-new-virtualenv-in-lion
>
> It says "Setting export VIRTUALENV_USE_DISTRIBUTE=1 fixed the problem."

Oh - that's probably because I have "export PYTHONDONTWRITEBYTECODE=1"
in my profile.

No worries - thanks!


>> (pgadmin4)piranha:pgAdmin4 dpage$ grep pgadmin4.db
>> pgadmin4.egg-info/SOURCES.txt |wc -l
>>0
>> (pgadmin4)piranha:pgAdmin4 dpage$ grep pyc pgadmin4.egg-info/SOURCES.txt
>> |wc -l
>>0
>> (pgadmin4)piranha:pgAdmin4 dpage$ git apply
>> ~/Downloads/manifest_bug_fix.patch
>> (pgadmin4)piranha:pgAdmin4 dpage$ make pip 1> /dev/null
>>
>> /Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/setuptools/dist.py:285:
>> UserWarning: Normalizing '1.0.0-dev' to '1.0.0.dev0'
>>   normalized_version,
>> package init file 'pgadmin4/__init__.py' not found (or not a regular file)
>> warning: manifest_maker: standard file 'setup_pip.py' not found
>>
>> warning: build_py: byte-compiling is disabled, skipping.
>>
>> warning: install_lib: byte-compiling is disabled, skipping.
>>
>> (pgadmin4)piranha:pgAdmin4 dpage$ grep pgadmin4.db
>> pgadmin4.egg-info/SOURCES.txt |wc -l
>>1
>> (pgadmin4)piranha:pgAdmin4 dpage$ grep pyc pgadmin4.egg-info/SOURCES.txt
>> |wc -l
>>   84
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:

[pgadmin-hackers] pgAdmin 4 commit: Fix PIP packaging code so it works nicely on Linux an

2016-03-15 Thread Dave Page
Fix PIP packaging code so it works nicely on Linux and Mac.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=b1d26db8d9f478d1a52327287c8f02739ba200a1
Author: Muhammad Aqeel 

Modified Files
--
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][psycopg2] - poll function local variable reference error

2016-03-15 Thread Neel Patel
Hi,

During the debugger implementation, we came to know that "poll()" function
is getting failed when the status is not equal to "ASYNC_OK". We are
getting the below error at python side.

"UnboundLocalError: local variable 'colinfo' referenced before assignment"


Attached is the patch that resolves the above error.

Do review it and let us know for comments.

Thanks,
Neel Patel


poll_local_var_error.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Adding to Documentation

2016-03-15 Thread Dave Page
Hi

On Tue, Mar 15, 2016 at 7:36 AM, Lev Lazinskiy  wrote:
> Hi Team!
>
> My name is Lev. I am a long time PostgreSQL user but just switched to
> pgadminIII when I switched to Ubuntu full time from OS X. My background
> is in testing, general GNU/Linux sys admin, databases, and python. I know 
> some C and C++ and would
> love to contribute more to this project.
>
> I was having some issues getting SSH tunneling to work and the solution
> was simply that I was not entering my passphrase for my encrypted key.
> I searched the web for this issue and there seems to be a bit of
> confusion around this with no great solution. Most users give up and
> revert to setting up an SSH tunnel locally and connecting to that.
>
> I wanted to add this to the application documentation under
> http://www.pgadmin.org/docs/1.22/connect-error.html, but I did not see
> any specific instructions or best practices on how to do that. Do I just
> hack away at the docs/connect-error.rst file and send a patch here?

Yes please. Please create patches from either git master or the
REL-1_22_0-PATCHES branch, using "git diff".

> Lastly, I am using pgAdmin III 1.20.0 Beta 2, but this documentation
> would really apply for any version that supports SSH tunneling.
> Is there a standard practice for "backporting" docs or do we just keep
> moving along.

We'll backport to 1.22 (or forward port from there to master), but
won't go further back than that as we'll never release another earlier
branch again.

Thanks!

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] Primary key constraint [pgadmin4]

2016-03-15 Thread Harshal Dhumal
Hi


PFA patch for primary key constraint.

Note: This patch has dependency on Table, Column node and backform
multiselect control.

-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/__init__.py
new file mode 100644
index 000..64f91e8
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/__init__.py
@@ -0,0 +1,129 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Implements Constraint Node"""
+
+from flask.ext.babel import gettext
+from flask import render_template, make_response
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases.schemas.tables as table
+from pgadmin.utils.ajax import make_json_response, \
+ make_response as ajax_response
+from .type import ConstraintRegistry
+
+
+class ConstraintsModule(CollectionNodeModule):
+"""
+class ConstraintsModule(CollectionNodeModule)
+
+A module class for Constraint node derived from CollectionNodeModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the ConstraintsModule and it's base module.
+
+* get_nodes(gid, sid, did)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node.
+
+* script_load()
+  - Load the module script for constraint node, when any of the database node is
+initialized.
+"""
+
+NODE_TYPE = 'constraints'
+COLLECTION_LABEL = gettext("Constraints")
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+super(ConstraintsModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid, tid):
+"""
+Generate the collection node
+"""
+yield self.generate_browser_collection_node(tid)
+
+@property
+def script_load(self):
+"""
+Load the module script for constraints, when any of the table node is
+initialized.
+"""
+return table.TableModule.NODE_TYPE
+
+blueprint = ConstraintsModule(__name__)
+
+
+@blueprint.route('/nodes//')
+def nodes(**kwargs):
+"""
+Returns all constraint as a tree node.
+
+Args:
+  **kwargs:
+
+Returns:
+
+"""
+
+cmd = {"cmd": "nodes"}
+res = []
+for name in ConstraintRegistry.registry:
+module = (ConstraintRegistry.registry[name])['nodeview']
+view = module(**cmd)
+res = res + view.get_nodes(**kwargs)
+
+return make_json_response(
+data=res,
+status=200
+)
+
+
+@blueprint.route('/obj//')
+def proplist(**kwargs):
+"""
+Returns all constraint with properties.
+Args:
+  **kwargs:
+
+Returns:
+
+"""
+
+cmd = {"cmd": "obj"}
+res = []
+for name in ConstraintRegistry.registry:
+module = (ConstraintRegistry.registry[name])['nodeview']
+view = module(**cmd)
+res = res + view.get_node_list(**kwargs)
+
+return ajax_response(
+response=res,
+status=200
+)
+
+
+@blueprint.route('/module.js')
+def module_js():
+"""
+  This property defines whether javascript exists for this node.
+
+"""
+return make_response(
+render_template(
+"constraints/js/constraints.js",
+_=gettext
+),
+200, {'Content-Type': 'application/x-javascript'}
+)
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/primary_key/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/primary_key/__init__.py
new file mode 100644
index 000..1abbe1d
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/primary_key/__init__.py
@@ -0,0 +1,774 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Implements Primary key constraint Node"""
+
+import json
+from flask import render_template, make_response, request, jsonify
+from flask.ext.babel import gettext as _
+from pgadmin.utils.ajax import make_json_response, \

Re: [pgadmin-hackers] Control for selecting multiple columns [pgadmin4]

2016-03-15 Thread Harshal Dhumal
Hi,

PFA generalized updated patch for backform multiSelectControl.

-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 

On Tue, Mar 8, 2016 at 1:04 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA backform control for selecting multiple columns.(This control depends
> on column node.)
>
> Usage:
>
> {
>   id: 'columns', label: '{{ _('Columns') }}',
>   type: 'collection', group: '{{ _('Definition') }}', editable:true,
>   canDelete: true, canAdd: true, control: Backform.MultiColumnSelectControl,
>   deps: ['index'], node: 'column',
>   model: pgBrowser.Node.Model.extend({
> keys: ['column'],
> defaults: {
>   column: undefined
> }
>   })
> }
>
>
> Note: When using this control model should have *column* attribute. And
> node property should be *column*.
>
>
>
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB 
>
diff --git a/web/pgadmin/browser/static/js/node.ui.js b/web/pgadmin/browser/static/js/node.ui.js
index b84b6ee..1202580 100644
--- a/web/pgadmin/browser/static/js/node.ui.js
+++ b/web/pgadmin/browser/static/js/node.ui.js
@@ -558,6 +558,46 @@ function($, _, pgAdmin, Backbone, Backform, Alertify, Node) {
 })
   });
 
+  /*
+   * Control to select multiple columns.
+   */
+  var MultiSelectAjaxControl = Backform.MultiSelectAjaxControl = NodeAjaxOptionsControl.extend({
+formatter: {
+  fromRaw: function (rawData, model) {
+return _.isObject(rawData) ? rawData : JSON.parse(rawData);
+  },
+  toRaw: function (formattedData, model) {
+return formattedData;
+  }
+},
+template: _.template([
+  '<%=label%>',
+  '',
+  '   <%=required ? "required" : ""%>>',
+  '<% for (var i=0; i < options.length; i++) { %>',
+  '  <% var option = options[i]; %>',
+  '   <%=value != null && _.indexOf(value, option.value) != -1 ? "selected" : ""%> <%=option.disabled ? "disabled=\'disabled\'" : ""%>><%-option.label%>',
+  '<% } %>',
+  '  ',
+  ''
+  ].join("\n")),
+getValueFromDOM: function() {
+  var res = [];
+
+  this.$el.find("select").find(':selected').each(function() {
+res.push($(this).attr('value'));
+  });
+
+  return res;
+},
+defaults: _.extend({}, NodeAjaxOptionsControl.prototype.defaults, {
+  select2: {
+multiple: true,
+allowClear: true,
+width: 'style'
+  }
+})
+  });
 
   return Backform;
 });

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] Adding to Documentation

2016-03-15 Thread Lev Lazinskiy
Hi Team!

My name is Lev. I am a long time PostgreSQL user but just switched to
pgadminIII when I switched to Ubuntu full time from OS X. My background
is in testing, general GNU/Linux sys admin, databases, and python. I know some 
C and C++ and would
love to contribute more to this project. 

I was having some issues getting SSH tunneling to work and the solution
was simply that I was not entering my passphrase for my encrypted key.
I searched the web for this issue and there seems to be a bit of
confusion around this with no great solution. Most users give up and
revert to setting up an SSH tunnel locally and connecting to that. 

I wanted to add this to the application documentation under
http://www.pgadmin.org/docs/1.22/connect-error.html, but I did not see
any specific instructions or best practices on how to do that. Do I just
hack away at the docs/connect-error.rst file and send a patch here? 

Lastly, I am using pgAdmin III 1.20.0 Beta 2, but this documentation
would really apply for any version that supports SSH tunneling.
Is there a standard practice for "backporting" docs or do we just keep
moving along. 

Looking forward to hearing from you soon! 

Best, 
Lev 


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers