Re: [pgadmin-hackers] Event trigges node patch [pgadmin4]

2016-03-10 Thread Dave Page
Thanks - applied with the following changes:

- Added owner and enabled status to properties list
- Display a list of trigger name, owner and comment when the collection
node is selected.
- Treat Event Triggers as a leaf node.

Please be mindful of these issues with any future patches.

Thanks again!

On Wed, Mar 9, 2016 at 11:04 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
>
> PFA updated patch for events trigger node.
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB 
>
> On Fri, Mar 4, 2016 at 7:58 PM, Dave Page  wrote:
>
>>
>>
>> On Fri, Feb 12, 2016 at 6:32 AM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch event triggers node.
>>>
>>>
>> Hi
>>
>> It looks like this has bit-rotted. Please update and re-submit -
>> currently it doesn't list triggers in the tree if they're already present,
>> and if you try to create a new one it fails to find any trigger functions.
>> I see this in the console:
>>
>> 2016-03-04 14:24:01,759: INFO werkzeug: 127.0.0.1 - - [04/Mar/2016
>> 14:24:01] "GET /browser/event_trigger/nodes/1/1/12403/ HTTP/1.1" 500 -
>> Traceback (most recent call last):
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1836, in __call__
>> return self.wsgi_app(environ, start_response)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1820, in wsgi_app
>> response = self.make_response(self.handle_exception(e))
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1403, in handle_exception
>> reraise(exc_type, exc_value, tb)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1817, in wsgi_app
>> response = self.full_dispatch_request()
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1477, in full_dispatch_request
>> rv = self.handle_user_exception(e)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1381, in handle_user_exception
>> reraise(exc_type, exc_value, tb)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1475, in full_dispatch_request
>> rv = self.dispatch_request()
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1461, in dispatch_request
>> return self.view_functions[rule.endpoint](**req.view_args)
>>   File
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
>> line 84, in view
>> return self.dispatch_request(*args, **kwargs)
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line
>> 248, in dispatch_request
>> return method(*args, **kwargs)
>>   File
>> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py",
>> line 118, in wrap
>> return f(*args, **kwargs)
>>   File
>> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py",
>> line 142, in nodes
>> res.append(
>> AttributeError: 'dict' object has no attribute 'append'
>>
>> NOTE: Please also check the code conforms to the checklist I added to the
>> docs earlier:
>> http://git.postgresql.org/gitweb/?p=pgadmin4.git;a=blob;f=docs/en_US/code-review.rst
>>
>> --
>> 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


Re: [pgadmin-hackers] Event trigges node patch [pgadmin4]

2016-03-09 Thread Harshal Dhumal
Hi,


PFA updated patch for events trigger node.

-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 

On Fri, Mar 4, 2016 at 7:58 PM, Dave Page  wrote:

>
>
> On Fri, Feb 12, 2016 at 6:32 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch event triggers node.
>>
>>
> Hi
>
> It looks like this has bit-rotted. Please update and re-submit - currently
> it doesn't list triggers in the tree if they're already present, and if you
> try to create a new one it fails to find any trigger functions. I see this
> in the console:
>
> 2016-03-04 14:24:01,759: INFO werkzeug: 127.0.0.1 - - [04/Mar/2016
> 14:24:01] "GET /browser/event_trigger/nodes/1/1/12403/ HTTP/1.1" 500 -
> Traceback (most recent call last):
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1836, in __call__
> return self.wsgi_app(environ, start_response)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1820, in wsgi_app
> response = self.make_response(self.handle_exception(e))
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1403, in handle_exception
> reraise(exc_type, exc_value, tb)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1817, in wsgi_app
> response = self.full_dispatch_request()
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1477, in full_dispatch_request
> rv = self.handle_user_exception(e)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1381, in handle_user_exception
> reraise(exc_type, exc_value, tb)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1475, in full_dispatch_request
> rv = self.dispatch_request()
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1461, in dispatch_request
> return self.view_functions[rule.endpoint](**req.view_args)
>   File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
> line 84, in view
> return self.dispatch_request(*args, **kwargs)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line 248,
> in dispatch_request
> return method(*args, **kwargs)
>   File
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py",
> line 118, in wrap
> return f(*args, **kwargs)
>   File
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py",
> line 142, in nodes
> res.append(
> AttributeError: 'dict' object has no attribute 'append'
>
> NOTE: Please also check the code conforms to the checklist I added to the
> docs earlier:
> http://git.postgresql.org/gitweb/?p=pgadmin4.git;a=blob;f=docs/en_US/code-review.rst
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
new file mode 100644
index 000..8e71a6e
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py
@@ -0,0 +1,658 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+import json
+import re
+from flask import render_template, make_response, request, jsonify
+from flask.ext.babel import gettext
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.collection import CollectionNodeModule
+import pgadmin.browser.server_groups.servers.databases as database
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class EventTriggerModule(CollectionNodeModule):
+"""
+class EventTriggerModule(CollectionNodeModule)
+
+A module class for Event trigger node derived from CollectionNodeModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the EventTriggerModule and it's base module.
+
+* get_nodes(gid, sid, did)
+  - Method is used to generate the browser collection node.
+
+* script_load()
+  - Load the module script for Event trigger, when any of the database node is
+initialized.
+"""
+
+ 

Re: [pgadmin-hackers] Event trigges node patch [pgadmin4]

2016-03-04 Thread Dave Page
On Fri, Feb 12, 2016 at 6:32 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch event triggers node.
>
>
Hi

It looks like this has bit-rotted. Please update and re-submit - currently
it doesn't list triggers in the tree if they're already present, and if you
try to create a new one it fails to find any trigger functions. I see this
in the console:

2016-03-04 14:24:01,759: INFO werkzeug: 127.0.0.1 - - [04/Mar/2016
14:24:01] "GET /browser/event_trigger/nodes/1/1/12403/ HTTP/1.1" 500 -
Traceback (most recent call last):
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1836, in __call__
return self.wsgi_app(environ, start_response)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1817, in wsgi_app
response = self.full_dispatch_request()
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1475, in full_dispatch_request
rv = self.dispatch_request()
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
line 84, in view
return self.dispatch_request(*args, **kwargs)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line 248,
in dispatch_request
return method(*args, **kwargs)
  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py",
line 118, in wrap
return f(*args, **kwargs)
  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/event_triggers/__init__.py",
line 142, in nodes
res.append(
AttributeError: 'dict' object has no attribute 'append'

NOTE: Please also check the code conforms to the checklist I added to the
docs earlier:
http://git.postgresql.org/gitweb/?p=pgadmin4.git;a=blob;f=docs/en_US/code-review.rst

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

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


[pgadmin-hackers] Event trigges node patch [pgadmin4]

2016-02-11 Thread Harshal Dhumal
Hi,

PFA patch event triggers node.


-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 


event_triggers_12_Frb_1.parch
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