Thread: pgadmin4 setup.py, first time run
Hi, When you try to run pgadmin4 for first time(without presence of pgadmin4.db), it ask you to run setup.py. When you run it,it throws python error as follows, Traceback (most recent call last): File "/home/test/Development/pgadmin4/web/setup.py", line 145, in <module> do_setup(app) File "/home/test/Development/pgadmin4/web/setup.py", line 57, in do_setup user_datastore.add_role_to_user(email, 'Administrators') File "/usr/local/lib/python2.7/dist-packages/Flask_Security-1.7.4-py2.7.egg/flask_security/datastore.py", line 106, inadd_role_to_user if role not in user.roles: AttributeError: 'NoneType' object has no attribute 'roles' It's because,user_datastore.create_role,user_datastore.create_user and user_datastore.add_role_to_user all calls are forin one database transaction. It need to commit it after first two calls or creating role and user for add_role_to_userto work, Find attached patch for this. regards, Prasad Somwanshi
Attachment
Khushboo, can you look at this please? Thanks. On Sun, Sep 6, 2015 at 12:42 AM, Prasad <prasad.s@mail.com> wrote: > Hi, > > When you try to run pgadmin4 for first time(without presence of pgadmin4.db), it ask you to run setup.py. When you runit, it throws python error as follows, > Traceback (most recent call last): > File "/home/test/Development/pgadmin4/web/setup.py", line 145, in <module> > do_setup(app) > File "/home/test/Development/pgadmin4/web/setup.py", line 57, in do_setup > user_datastore.add_role_to_user(email, 'Administrators') > File "/usr/local/lib/python2.7/dist-packages/Flask_Security-1.7.4-py2.7.egg/flask_security/datastore.py", line 106, inadd_role_to_user > if role not in user.roles: > AttributeError: 'NoneType' object has no attribute 'roles' > > It's because,user_datastore.create_role,user_datastore.create_user and user_datastore.add_role_to_user all calls are forin one database transaction. It need to commit it after first two calls or creating role and user for add_role_to_userto work, > > Find attached patch for this. > > regards, > Prasad Somwanshi > > > -- > 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
Yes. I am looking into this.
Thanks,On Mon, Sep 7, 2015 at 1:31 PM, Dave Page <dpage@pgadmin.org> wrote:
Khushboo, can you look at this please?
Thanks.
On Sun, Sep 6, 2015 at 12:42 AM, Prasad <prasad.s@mail.com> wrote:
> Hi,
>
> When you try to run pgadmin4 for first time(without presence of pgadmin4.db), it ask you to run setup.py. When you run it, it throws python error as follows,
> Traceback (most recent call last):
> File "/home/test/Development/pgadmin4/web/setup.py", line 145, in <module>
> do_setup(app)
> File "/home/test/Development/pgadmin4/web/setup.py", line 57, in do_setup
> user_datastore.add_role_to_user(email, 'Administrators')
> File "/usr/local/lib/python2.7/dist-packages/Flask_Security-1.7.4-py2.7.egg/flask_security/datastore.py", line 106, in add_role_to_user
> if role not in user.roles:
> AttributeError: 'NoneType' object has no attribute 'roles'
>
> It's because,user_datastore.create_role,user_datastore.create_user and user_datastore.add_role_to_user all calls are for in one database transaction. It need to commit it after first two calls or creating role and user for add_role_to_user to work,
>
> Find attached patch for this.
>
> regards,
> Prasad Somwanshi
>
>
> --
> 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
Hi Dave,
I have tried to reproduce the issue but couldn't reproduce it on UBUNTU as well as on MAC.
I have checked the online examples of SQLAlchemyUserDatastore, and I think
it is logical that before assigning the new role to the newly created user, user should be committed first.
Thanks,I have tried to reproduce the issue but couldn't reproduce it on UBUNTU as well as on MAC.
I have checked the online examples of SQLAlchemyUserDatastore, and I think
it is logical that before assigning the new role to the newly created user, user should be committed first.
On Mon, Sep 7, 2015 at 1:49 PM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
KhushbooYes. I am looking into this.Thanks,On Mon, Sep 7, 2015 at 1:31 PM, Dave Page <dpage@pgadmin.org> wrote:Khushboo, can you look at this please?
Thanks.
On Sun, Sep 6, 2015 at 12:42 AM, Prasad <prasad.s@mail.com> wrote:
> Hi,
>
> When you try to run pgadmin4 for first time(without presence of pgadmin4.db), it ask you to run setup.py. When you run it, it throws python error as follows,
> Traceback (most recent call last):
> File "/home/test/Development/pgadmin4/web/setup.py", line 145, in <module>
> do_setup(app)
> File "/home/test/Development/pgadmin4/web/setup.py", line 57, in do_setup
> user_datastore.add_role_to_user(email, 'Administrators')
> File "/usr/local/lib/python2.7/dist-packages/Flask_Security-1.7.4-py2.7.egg/flask_security/datastore.py", line 106, in add_role_to_user
> if role not in user.roles:
> AttributeError: 'NoneType' object has no attribute 'roles'
>
> It's because,user_datastore.create_role,user_datastore.create_user and user_datastore.add_role_to_user all calls are for in one database transaction. It need to commit it after first two calls or creating role and user for add_role_to_user to work,
>
> Find attached patch for this.
>
> regards,
> Prasad Somwanshi
>
>
> --
> 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
<div style="font-family: Verdana;font-size: 12.0px;"><div>I'd this issue on Ubuntu x64. And using Python editor IDLE to runsetup.py</div><div> </div><div>regards,</div><div>Prasad Somwanshi<br /><br /> <br /> <br /><br /> Sent: Monday, September07, 2015 at 12:36 PM<br /> From: "Khushboo Vashi" <khushboo.vashi@enterprisedb.com><br /> To: "Dave Page"<dpage@pgadmin.org><br /> Cc: Prasad <prasad.s@mail.com>, pgadmin-hackers <pgadmin-hackers@postgresql.org><br/> Subject: Re: [pgadmin-hackers] pgadmin4 setup.py, first time run<br /><br />Hi Dave,<br /><br /> I have tried to reproduce the issue but couldn't reproduce it on UBUNTU as well as on MAC.<br /><br/> I have checked the online examples of SQLAlchemyUserDatastore, and I think<br /> it is logical that before assigningthe new role to the newly created user, user should be committed first.<br /> Thanks,Khushboo<br /><br /> <br/> On Mon, Sep 7, 2015 at 1:49 PM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:<br /><br /> Yes. I amlooking into this.<br /> Thanks,Khushboo<br /><br /> <br /> On Mon, Sep 7, 2015 at 1:31 PM, Dave Page <dpage@pgadmin.org[dpage@pgadmin.org]>wrote:Khushboo, can you look at this please?<br /><br /> Thanks.<br /><br />On Sun, Sep 6, 2015 at 12:42 AM, Prasad <prasad.s@mail.com[prasad.s@mail.com]> wrote:<br /> > Hi,<br /> ><br/> > When you try to run pgadmin4 for first time(without presence of pgadmin4.db), it ask you to run setup.py.When you run it, it throws python error as follows,<br /> > Traceback (most recent call last):<br /> > File"/home/test/Development/pgadmin4/web/setup.py", line 145, in <module><br /> > do_setup(app)<br /> > File "/home/test/Development/pgadmin4/web/setup.py", line 57, in do_setup<br /> > user_datastore.add_role_to_user(email,'Administrators')<br /> > File "/usr/local/lib/python2.7/dist-packages/Flask_Security-1.7.4-py2.7.egg/flask_security/datastore.py",line 106, in add_role_to_user<br/> > if role not in user.roles:<br /> > AttributeError: 'NoneType' object has no attribute 'roles'<br/> ><br /> > It's because,user_datastore.create_role,user_datastore.create_user and user_datastore.add_role_to_userall calls are for in one database transaction. It need to commit it after first two callsor creating role and user for add_role_to_user to work,<br /> ><br /> > Find attached patch for this.<br /> ><br/> > regards,<br /> > Prasad Somwanshi<br /> ><br /> ><br /> > --<br /> > Sent via pgadmin-hackersmailing list (pgadmin-hackers@postgresql.org[pgadmin-hackers@postgresql.org])<br /> > To make changes toyour subscription:<br /> > <a href="http://www.postgresql.org/mailpref/pgadmin-hackers" target="_blank">http://www.postgresql.org/mailpref/pgadmin-hackers</a>[<a href="http://www.postgresql.org/mailpref/pgadmin-hackers" target="_blank">http://www.postgresql.org/mailpref/pgadmin-hackers</a>]<br/> ><br /><br /><br /><br /> --<br /> Dave Page<br/> Blog: <a href="http://pgsnake.blogspot.com" target="_blank">http://pgsnake.blogspot.com</a>[<a href="http://pgsnake.blogspot.com"target="_blank">http://pgsnake.blogspot.com</a>]<br /> Twitter: @pgsnake<br /><br /> EnterpriseDBUK: <a href="http://www.enterprisedb.com" target="_blank">http://www.enterprisedb.com</a>[<a href="http://www.enterprisedb.com"target="_blank">http://www.enterprisedb.com</a>]<br /> The Enterprise PostgreSQL Company</div></div>
On Mon, Sep 7, 2015 at 12:36 PM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote: > Hi Dave, > > I have tried to reproduce the issue but couldn't reproduce it on UBUNTU as > well as on MAC. OK. > I have checked the online examples of SQLAlchemyUserDatastore, and I think > it is logical that before assigning the new role to the newly created user, > user should be committed first. Any particular reason why? Queries within a given transaction should normally see changes made by other queries in the same transaction. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
On Mon, Sep 7, 2015 at 5:28 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Sep 7, 2015 at 12:36 PM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi Dave,
>
> I have tried to reproduce the issue but couldn't reproduce it on UBUNTU as
> well as on MAC.
OK.
> I have checked the online examples of SQLAlchemyUserDatastore, and I think
> it is logical that before assigning the new role to the newly created user,
> user should be committed first.
Any particular reason why? Queries within a given transaction should
normally see changes made by other queries in the same transaction.
I have followed below links for SQLAlchemyUserDatastore, so I thought this way.
https://github.com/sasaporta/flask-security-admin-example/blob/master/main.py
http://git.twopicode.com/nickw/flask-boilerplate/raw/f954ccd6e3269b043d0b33b3be1c3bfb90c358d3/WebApp/Application/__init__.py
https://github.com/sasaporta/flask-security-admin-example/blob/master/main.py
http://git.twopicode.com/nickw/flask-boilerplate/raw/f954ccd6e3269b043d0b33b3be1c3bfb90c358d3/WebApp/Application/__init__.py
Also, I have read that, if the Role has already been created then we can assign that role while creating the new user. So, I thought Role should be committed first and then we can use it. May be this was my misunderstanding.
Thanks,
Khushboo
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Mon, Sep 7, 2015 at 5:27 PM, Prasad <prasad.s@mail.com> wrote:
I'd this issue on Ubuntu x64. And using Python editor IDLE to run setup.py
I have also tried on Ubuntu x64, but couldn't reproduce.
regards,Prasad Somwanshi
Sent: Monday, September 07, 2015 at 12:36 PM
From: "Khushboo Vashi" <khushboo.vashi@enterprisedb.com>
To: "Dave Page" <dpage@pgadmin.org>
Cc: Prasad <prasad.s@mail.com>, pgadmin-hackers <pgadmin-hackers@postgresql.org>
Subject: Re: [pgadmin-hackers] pgadmin4 setup.py, first time run
Hi Dave,
I have tried to reproduce the issue but couldn't reproduce it on UBUNTU as well as on MAC.
I have checked the online examples of SQLAlchemyUserDatastore, and I think
it is logical that before assigning the new role to the newly created user, user should be committed first.
Thanks,Khushboo
On Mon, Sep 7, 2015 at 1:49 PM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Yes. I am looking into this.
Thanks,Khushboo
On Mon, Sep 7, 2015 at 1:31 PM, Dave Page <dpage@pgadmin.org[dpage@pgadmin.org]> wrote:Khushboo, can you look at this please?
Thanks.
On Sun, Sep 6, 2015 at 12:42 AM, Prasad <prasad.s@mail.com[prasad.s@mail.com]> wrote:
> Hi,
>
> When you try to run pgadmin4 for first time(without presence of pgadmin4.db), it ask you to run setup.py. When you run it, it throws python error as follows,
> Traceback (most recent call last):
> File "/home/test/Development/pgadmin4/web/setup.py", line 145, in <module>
> do_setup(app)
> File "/home/test/Development/pgadmin4/web/setup.py", line 57, in do_setup
> user_datastore.add_role_to_user(email, 'Administrators')
> File "/usr/local/lib/python2.7/dist-packages/Flask_Security-1.7.4-py2.7.egg/flask_security/datastore.py", line 106, in add_role_to_user
> if role not in user.roles:
> AttributeError: 'NoneType' object has no attribute 'roles'
>
> It's because,user_datastore.create_role,user_datastore.create_user and user_datastore.add_role_to_user all calls are for in one database transaction. It need to commit it after first two calls or creating role and user for add_role_to_user to work,
>
> Find attached patch for this.
>
> regards,
> Prasad Somwanshi
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org[pgadmin-hackers@postgresql.org])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers[http://www.postgresql.org/mailpref/pgadmin-hackers]
>
--
Dave Page
Blog: http://pgsnake.blogspot.com[http://pgsnake.blogspot.com]
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com[http://www.enterprisedb.com]
The Enterprise PostgreSQL Company
On Mon, Sep 7, 2015 at 1:53 PM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote: > > > On Mon, Sep 7, 2015 at 5:28 PM, Dave Page <dpage@pgadmin.org> wrote: >> >> On Mon, Sep 7, 2015 at 12:36 PM, Khushboo Vashi >> <khushboo.vashi@enterprisedb.com> wrote: >> > Hi Dave, >> > >> > I have tried to reproduce the issue but couldn't reproduce it on UBUNTU >> > as >> > well as on MAC. >> >> OK. >> >> > I have checked the online examples of SQLAlchemyUserDatastore, and I >> > think >> > it is logical that before assigning the new role to the newly created >> > user, >> > user should be committed first. >> >> Any particular reason why? Queries within a given transaction should >> normally see changes made by other queries in the same transaction. > > > I have followed below links for SQLAlchemyUserDatastore, so I thought this > way. > > https://github.com/sasaporta/flask-security-admin-example/blob/master/main.py > http://git.twopicode.com/nickw/flask-boilerplate/raw/f954ccd6e3269b043d0b33b3be1c3bfb90c358d3/WebApp/Application/__init__.py > > Also, I have read that, if the Role has already been created then we can > assign that role while creating the new user. So, I thought Role should be > committed first and then we can use it. May be this was my misunderstanding. OK, well it won't hurt to have an extra commit in there. Ashesh; can you commit this change please? -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
On Mon, Sep 7, 2015 at 6:29 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Sep 7, 2015 at 1:53 PM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
>
>
> On Mon, Sep 7, 2015 at 5:28 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> On Mon, Sep 7, 2015 at 12:36 PM, Khushboo Vashi
>> <khushboo.vashi@enterprisedb.com> wrote:
>> > Hi Dave,
>> >
>> > I have tried to reproduce the issue but couldn't reproduce it on UBUNTU
>> > as
>> > well as on MAC.
>>
>> OK.
>>
>> > I have checked the online examples of SQLAlchemyUserDatastore, and I
>> > think
>> > it is logical that before assigning the new role to the newly created
>> > user,
>> > user should be committed first.
>>
>> Any particular reason why? Queries within a given transaction should
>> normally see changes made by other queries in the same transaction.
>
>
> I have followed below links for SQLAlchemyUserDatastore, so I thought this
> way.
>
> https://github.com/sasaporta/flask-security-admin-example/blob/master/main.py
> http://git.twopicode.com/nickw/flask-boilerplate/raw/f954ccd6e3269b043d0b33b3be1c3bfb90c358d3/WebApp/Application/__init__.py
>
> Also, I have read that, if the Role has already been created then we can
> assign that role while creating the new user. So, I thought Role should be
> committed first and then we can use it. May be this was my misunderstanding.
OK, well it won't hurt to have an extra commit in there. Ashesh; can
you commit this change please?
Sure.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
If you want DML to be sent to the database with SQLAlchemy, you don't necessarily need to commit: the flush() method will send all pending DML operations without commiting. Le Monday 07 September 2015 18:31:58 Ashesh Vashi a écrit : > On Mon, Sep 7, 2015 at 6:29 PM, Dave Page <dpage@pgadmin.org> wrote: > > On Mon, Sep 7, 2015 at 1:53 PM, Khushboo Vashi > > > > <khushboo.vashi@enterprisedb.com> wrote: > > > On Mon, Sep 7, 2015 at 5:28 PM, Dave Page <dpage@pgadmin.org> wrote: > > >> On Mon, Sep 7, 2015 at 12:36 PM, Khushboo Vashi > > >> > > >> <khushboo.vashi@enterprisedb.com> wrote: > > >> > Hi Dave, > > >> > > > >> > I have tried to reproduce the issue but couldn't reproduce it on > > > > UBUNTU > > > > >> > as > > >> > well as on MAC. > > >> > > >> OK. > > >> > > >> > I have checked the online examples of SQLAlchemyUserDatastore, and I > > >> > think > > >> > it is logical that before assigning the new role to the newly created > > >> > user, > > >> > user should be committed first. > > >> > > >> Any particular reason why? Queries within a given transaction should > > >> normally see changes made by other queries in the same transaction. > > > > > > I have followed below links for SQLAlchemyUserDatastore, so I thought > > > > this > > > > > way. > > > > https://github.com/sasaporta/flask-security-admin-example/blob/master/main > > .py > > > > http://git.twopicode.com/nickw/flask-boilerplate/raw/f954ccd6e3269b043d0b3 > > 3b3be1c3bfb90c358d3/WebApp/Application/__init__.py> > > > Also, I have read that, if the Role has already been created then we can > > > assign that role while creating the new user. So, I thought Role should > > > > be > > > > > committed first and then we can use it. May be this was my > > > > misunderstanding. > > > > OK, well it won't hurt to have an extra commit in there. Ashesh; can > > you commit this change please? > > Sure. > > > -- > > Thanks & Regards, > > Ashesh Vashi > EnterpriseDB INDIA: Enterprise PostgreSQL Company > <http://www.enterprisedb.com> > > > *http://www.linkedin.com/in/asheshvashi* > <http://www.linkedin.com/in/asheshvashi> > > > -- > > Dave Page > > Blog: http://pgsnake.blogspot.com > > Twitter: @pgsnake > > > > EnterpriseDB UK: http://www.enterprisedb.com > > The Enterprise PostgreSQL Company -- Ronan Dunklau http://dalibo.com - http://dalibo.org
Attachment
On Tue, Sep 8, 2015 at 2:54 PM, Ronan Dunklau <ronan.dunklau@dalibo.com> wrote:
If you want DML to be sent to the database with SQLAlchemy, you don't
necessarily need to commit: the flush() method will send all pending DML
operations without commiting.
What do you suggest - should we should use flush(...) instead of commit(...)?
Prasad,
As none of us is able to reproduce the issue at our end, can you please check flush instead of commit at your end?
> <http://www.enterprisedb.com>
Le Monday 07 September 2015 18:31:58 Ashesh Vashi a écrit :
> On Mon, Sep 7, 2015 at 6:29 PM, Dave Page <dpage@pgadmin.org> wrote:
> > On Mon, Sep 7, 2015 at 1:53 PM, Khushboo Vashi
> >
> > <khushboo.vashi@enterprisedb.com> wrote:
> > > On Mon, Sep 7, 2015 at 5:28 PM, Dave Page <dpage@pgadmin.org> wrote:
> > >> On Mon, Sep 7, 2015 at 12:36 PM, Khushboo Vashi
> > >>
> > >> <khushboo.vashi@enterprisedb.com> wrote:
> > >> > Hi Dave,
> > >> >
> > >> > I have tried to reproduce the issue but couldn't reproduce it on
> >
> > UBUNTU
> >
> > >> > as
> > >> > well as on MAC.
> > >>
> > >> OK.
> > >>
> > >> > I have checked the online examples of SQLAlchemyUserDatastore, and I
> > >> > think
> > >> > it is logical that before assigning the new role to the newly created
> > >> > user,
> > >> > user should be committed first.
> > >>
> > >> Any particular reason why? Queries within a given transaction should
> > >> normally see changes made by other queries in the same transaction.
> > >
> > > I have followed below links for SQLAlchemyUserDatastore, so I thought
> >
> > this
> >
> > > way.
> >
> > https://github.com/sasaporta/flask-security-admin-example/blob/master/main
> > .py
> >
> > http://git.twopicode.com/nickw/flask-boilerplate/raw/f954ccd6e3269b043d0b3
> > 3b3be1c3bfb90c358d3/WebApp/Application/__init__.py>
> > > Also, I have read that, if the Role has already been created then we can
> > > assign that role while creating the new user. So, I thought Role should
> >
> > be
> >
> > > committed first and then we can use it. May be this was my
> >
> > misunderstanding.
> >
> > OK, well it won't hurt to have an extra commit in there. Ashesh; can
> > you commit this change please?
>
> Sure.
>
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>
>
> *http://www.linkedin.com/in/asheshvashi*
> <http://www.linkedin.com/in/asheshvashi>-->
> > --
> > Dave Page
> > Blog: http://pgsnake.blogspot.com
> > Twitter: @pgsnake
> >
> > EnterpriseDB UK: http://www.enterprisedb.com
> > The Enterprise PostgreSQL Company
Ronan Dunklau
http://dalibo.com - http://dalibo.org
Yes, using flush does work. regards, Prasad Somwanshi Sent: Tuesday, September 08, 2015 at 11:14 AM From: "Ashesh Vashi" <ashesh.vashi@enterprisedb.com> To: "Ronan Dunklau" <ronan.dunklau@dalibo.com> Cc: pgadmin-hackers <pgadmin-hackers@postgresql.org>, "Dave Page" <dpage@pgadmin.org>, "Khushboo Vashi" <khushboo.vashi@enterprisedb.com>,Prasad <prasad.s@mail.com> Subject: Re: [pgadmin-hackers] pgadmin4 setup.py, first time run On Tue, Sep 8, 2015 at 2:54 PM, Ronan Dunklau <ronan.dunklau@dalibo.com> wrote: If you want DML to be sent to the database with SQLAlchemy, you don't necessarily need to commit: the flush() method will send all pending DML operations without commiting. What do you suggest - should we should use flush(...) instead of commit(...)? Prasad, As none of us is able to reproduce the issue at our end, can you please check flush instead of commit at your end? -- Thanks & Regards, Ashesh Vashi EnterpriseDB INDIA: Enterprise PostgreSQL Company[http://www.enterprisedb.com] http://www.linkedin.com/in/asheshvashi[http://www.linkedin.com/in/asheshvashi] Le Monday 07 September 2015 18:31:58 Ashesh Vashi a écrit : > On Mon, Sep 7, 2015 at 6:29 PM, Dave Page <dpage@pgadmin.org[dpage@pgadmin.org]> wrote: > > On Mon, Sep 7, 2015 at 1:53 PM, Khushboo Vashi > > > > <khushboo.vashi@enterprisedb.com[khushboo.vashi@enterprisedb.com]> wrote: > > > On Mon, Sep 7, 2015 at 5:28 PM, Dave Page <dpage@pgadmin.org[dpage@pgadmin.org]> wrote: > > >> On Mon, Sep 7, 2015 at 12:36 PM, Khushboo Vashi > > >> > > >> <khushboo.vashi@enterprisedb.com[khushboo.vashi@enterprisedb.com]> wrote: > > >> > Hi Dave, > > >> > > > >> > I have tried to reproduce the issue but couldn't reproduce it on > > > > UBUNTU > > > > >> > as > > >> > well as on MAC. > > >> > > >> OK. > > >> > > >> > I have checked the online examples of SQLAlchemyUserDatastore, and I > > >> > think > > >> > it is logical that before assigning the new role to the newly created > > >> > user, > > >> > user should be committed first. > > >> > > >> Any particular reason why? Queries within a given transaction should > > >> normally see changes made by other queries in the same transaction. > > > > > > I have followed below links for SQLAlchemyUserDatastore, so I thought > > > > this > > > > > way. > > > > https://github.com/sasaporta/flask-security-admin-example/blob/master/main[https://github.com/sasaporta/flask-security-admin-example/blob/master/main] > > .py > > > > http://git.twopicode.com/nickw/flask-boilerplate/raw/f954ccd6e3269b043d0b3[http://git.twopicode.com/nickw/flask-boilerplate/raw/f954ccd6e3269b043d0b3] > > 3b3be1c3bfb90c358d3/WebApp/Application/__init__.py> > > > Also, I have read that, if the Role has already been created then we can > > > assign that role while creating the new user. So, I thought Role should > > > > be > > > > > committed first and then we can use it. May be this was my > > > > misunderstanding. > > > > OK, well it won't hurt to have an extra commit in there. Ashesh; can > > you commit this change please? > > Sure. > > > -- > > Thanks & Regards, > > Ashesh Vashi > EnterpriseDB INDIA: Enterprise PostgreSQL Company> <http://www.enterprisedb.com[http://www.enterprisedb.com]> > > > *http://www.linkedin.com/in/asheshvashi*[http://www.linkedin.com/in/asheshvashi*] > <http://www.linkedin.com/in/asheshvashi[http://www.linkedin.com/in/asheshvashi]> > > > -- > > Dave Page > > Blog: http://pgsnake.blogspot.com[http://pgsnake.blogspot.com] > > Twitter: @pgsnake > > > > EnterpriseDB UK: http://www.enterprisedb.com[http://www.enterprisedb.com] > > The Enterprise PostgreSQL Company -- Ronan Dunklau http://dalibo.com[http://dalibo.com] - http://dalibo.org[http://dalibo.org]
Done.
Good. Still surprised that nobody encountered it so far. It would have nice, if I got a mention in commit log , :( regards, Prasad Sent: Tuesday, September 22, 2015 at 6:50 AM From: "Ashesh Vashi" <ashesh.vashi@enterprisedb.com> To: "Prasad Somwanshi" <prasad.s@mail.com> Cc: pgadmin-hackers <pgadmin-hackers@postgresql.org> Subject: Re: [pgadmin-hackers] pgadmin4 setup.py, first time run Done. -- Thanks & Regards, Ashesh Vashi EnterpriseDB INDIA: Enterprise PostgreSQL Company[http://www.enterprisedb.com] http://www.linkedin.com/in/asheshvashi[http://www.linkedin.com/in/asheshvashi]
On Tue, Sep 22, 2015 at 3:39 PM, Prasad Somwanshi <prasad.s@mail.com> wrote:
Good. Still surprised that nobody encountered it so far.
It would have nice, if I got a mention in commit log , :(
I sure - you will be for your contribution in future.
Please keep contributing.
Thanks once again.
regards,
Prasad
Sent: Tuesday, September 22, 2015 at 6:50 AM
From: "Ashesh Vashi" <ashesh.vashi@enterprisedb.com>
To: "Prasad Somwanshi" <prasad.s@mail.com>
Cc: pgadmin-hackers <pgadmin-hackers@postgresql.org>
Subject: Re: [pgadmin-hackers] pgadmin4 setup.py, first time run
Done.
--
Thanks & Regards,
Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company[http://www.enterprisedb.com]
http://www.linkedin.com/in/asheshvashi[http://www.linkedin.com/in/asheshvashi]--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers