Re: [TurboGears] Re: Turbogears 2 (latest as of 4/13/17) gearbox serve --reload --debug

2017-05-04 Thread Paul Kraus
​Life saver i have been refreshing the page and then trying to get back to
the other window in time for the ctrl-c.

Thanks!​

Paul Kraus
Director of IT

PEL, LLC
4666 Manufacturing Avenue
Cleveland, OH 44135
Phone: 800.321.1264
Fax: 800.222.6176
www.pelservice.com 

On Thu, May 4, 2017 at 1:48 PM, Jacob Ross  wrote:

> I've been running into the same thing on Win 8.1.
>
> I've found that  +  works reliably.
>
>
> On Saturday, April 22, 2017 at 11:23:53 AM UTC-6, pkraus wrote:
>>
>> Confirmed every turbgears application is doing this for me in windows but
>> not in linux
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TurboGears" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/turbogears/AZg9Nvjgy5Y/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> turbogears+unsubscr...@googlegroups.com.
> To post to this group, send email to turbogears@googlegroups.com.
> Visit this group at https://groups.google.com/group/turbogears.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


[TurboGears] Re: Turbogears 2 (latest as of 4/13/17) gearbox serve --reload --debug

2017-05-04 Thread Jacob Ross
I've been running into the same thing on Win 8.1.

I've found that  +  works reliably.

On Saturday, April 22, 2017 at 11:23:53 AM UTC-6, pkraus wrote:
>
> Confirmed every turbgears application is doing this for me in windows but 
> not in linux

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


[TurboGears] Re: elixir with turbogears2

2017-05-04 Thread D R Dinesh Kumar
Hi Tamas,

yes you are right. 
Also, we have base_config.use_sqlalchemy in app_cfg.py to trigger this.

all our queries are using elixir like:
model.Class.query.filter()...

and doesn't use "session" at all. Not sure if this is the reason for the 
error.
Any help is greatly appreciated.

With Regards,
Dinesh.

On Wednesday, 3 May 2017 23:51:56 UTC-7, D R Dinesh Kumar wrote:
>
> Hi All,
>
> We were using Elixir with TG1 and we have recently migrated to TG2.
> Finding difficulty in hooking the TG2 session to Elixir session and 
> metadata. 
>
> we were using the following statement in TG1 for the hook:
> from turbogears.database import metadata as __metadata__
> from elixir import sqlalchemy
> __metadata__ = sqlalchemy.MetaData()
> __engine__ = sqlalchemy.create_engine("...')
> __metadata__.engine = __engine__
> setup_all()
> create_all()
>
> The above code was doing very good and didnt find any issues at all.
>
> Can you please help how to do the same in TG2? turbogears.database is not 
> available anymore.
>
> With Regards,
> Dinesh.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] Re: elixir with turbogears2

2017-05-04 Thread Tamas Hegedus

Hi,

I did it 1-2 years ago...
I think that I also made quickstart without sqlalchemy support.
I think that sqlalchemy is always a separate thing and in your 
model/__init__.py:

from sqlalchemy.orm import scoped_session, sessionmaker

I am not an expert, but I think that scoped_session and sessionmaker are 
sqlalchemy objects and Elixir just references them. Elixir just makes a 
wrapping around sqlalchemy to have a simpler syntax.


Tamas

On 05/04/2017 06:27 PM, D R Dinesh Kumar wrote:

Hi Tamas,

Thanks a lot for the details reply.
Should I quickstart the project with "sqlalchemy support" for this?
Since  quickstart, by default enables tg's sqla in my application, I had
to quickstart without sqla and use the elixir.sqlalchemy in my
application (explicitly installing sqlachemy and elixir).
so the scoped_session and sessionmaker both are derived from
elixir.sqlalchemy but not tg.sqlalchemy. Is this the right scenario?
because, tg's session/metadata is not used here too. Please correct me
what am I missing here.


Regarding moving out of Elixir, there is a lot of code already built on
top of Elixir. Not sure how difficult to move this to sqlalchemy. But
surely we need to give it a try. This point from you, is really helpful.

With Regards,
Dinesh.

On Wednesday, 3 May 2017 23:51:56 UTC-7, D R Dinesh Kumar wrote:

Hi All,

We were using Elixir with TG1 and we have recently migrated to TG2.
Finding difficulty in hooking the TG2 session to Elixir session and
metadata.

we were using the following statement in TG1 for the hook:
from turbogears.database import metadata as __metadata__
from elixir import sqlalchemy
__metadata__ = sqlalchemy.MetaData()
__engine__ = sqlalchemy.create_engine("...')
__metadata__.engine = __engine__
setup_all()
create_all()

The above code was doing very good and didnt find any issues at all.

Can you please help how to do the same in TG2? turbogears.database
is not available anymore.

With Regards,
Dinesh.

--
You received this message because you are subscribed to the Google
Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to turbogears+unsubscr...@googlegroups.com
.
To post to this group, send email to turbogears@googlegroups.com
.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


[TurboGears] Re: elixir with turbogears2

2017-05-04 Thread D R Dinesh Kumar
I would also like to mention that, I started hitting the following error 
with TG2 regularly.

first: sql has gone away 
and then the below error:
StatementError: (sqlalchemy.exc.InvalidRequestError) Can't reconnect until 
invalid transaction is rolled back 

we were never hitting this issue with TG1 though. I haven't changed 
wait_timeouts and any other variable in my DB. 

With Regards,
Dinesh.

On Wednesday, 3 May 2017 23:51:56 UTC-7, D R Dinesh Kumar wrote:
>
> Hi All,
>
> We were using Elixir with TG1 and we have recently migrated to TG2.
> Finding difficulty in hooking the TG2 session to Elixir session and 
> metadata. 
>
> we were using the following statement in TG1 for the hook:
> from turbogears.database import metadata as __metadata__
> from elixir import sqlalchemy
> __metadata__ = sqlalchemy.MetaData()
> __engine__ = sqlalchemy.create_engine("...')
> __metadata__.engine = __engine__
> setup_all()
> create_all()
>
> The above code was doing very good and didnt find any issues at all.
>
> Can you please help how to do the same in TG2? turbogears.database is not 
> available anymore.
>
> With Regards,
> Dinesh.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


[TurboGears] Re: elixir with turbogears2

2017-05-04 Thread D R Dinesh Kumar
Hi Tamas,

Thanks a lot for the details reply. 
Should I quickstart the project with "sqlalchemy support" for this? Since 
 quickstart, by default enables tg's sqla in my application, I had to 
quickstart without sqla and use the elixir.sqlalchemy in my application 
(explicitly installing sqlachemy and elixir). 
so the scoped_session and sessionmaker both are derived from 
elixir.sqlalchemy but not tg.sqlalchemy. Is this the right scenario? 
because, tg's session/metadata is not used here too. Please correct me what 
am I missing here.


Regarding moving out of Elixir, there is a lot of code already built on top 
of Elixir. Not sure how difficult to move this to sqlalchemy. But surely we 
need to give it a try. This point from you, is really helpful.

With Regards,
Dinesh.

On Wednesday, 3 May 2017 23:51:56 UTC-7, D R Dinesh Kumar wrote:
>
> Hi All,
>
> We were using Elixir with TG1 and we have recently migrated to TG2.
> Finding difficulty in hooking the TG2 session to Elixir session and 
> metadata. 
>
> we were using the following statement in TG1 for the hook:
> from turbogears.database import metadata as __metadata__
> from elixir import sqlalchemy
> __metadata__ = sqlalchemy.MetaData()
> __engine__ = sqlalchemy.create_engine("...')
> __metadata__.engine = __engine__
> setup_all()
> create_all()
>
> The above code was doing very good and didnt find any issues at all.
>
> Can you please help how to do the same in TG2? turbogears.database is not 
> available anymore.
>
> With Regards,
> Dinesh.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


Re: [TurboGears] elixir with turbogears2

2017-05-04 Thread Tamas Hegedus

Hi,

1. I think that you should check the documentation of TG2.
And check out your model/__init__.py
Something like that should work:
maker = sessionmaker(autoflush=False, autocommit=False,
 extension=ZopeTransactionExtension())
DBSession = scoped_session(maker)
DeclarativeBase = declarative_base()
metadata = DeclarativeBase.metadata
import elixir
elixir.session = DBSession
elixir.metadata = metadata
def init_model(engine):
"""Call me before using any of the tables or classes in the model."""
DBSession.configure(bind=engine)
from yourproject.model.Entities import *
elixir.setup_all()

2. You will (are predicted to) run into a problem with a newer version 
of SQLAlchemy. Some classes are defined somewhere else than in earlier 
versions. Thus the last version of Elixir can not import that class from 
SQLalchemy. You should change that in the source of Elixir (to set the 
correct "path" (import statement) to that class). I do not find it now 
and can not remember. If this happens and you are at that step and can 
not solve, let me know.


3. I have been a big fun of Elixir. However, I think that it is not 
developed actively. In addition SQLAlchemy has developed a lot in the 
last 10 years. So try to get rid of Elixir and use pure SQLAlchemy.


Bests,
Tamas

On 05/04/2017 08:51 AM, D R Dinesh Kumar wrote:

Hi All,

We were using Elixir with TG1 and we have recently migrated to TG2.
Finding difficulty in hooking the TG2 session to Elixir session and
metadata.

we were using the following statement in TG1 for the hook:
from turbogears.database import metadata as __metadata__
from elixir import sqlalchemy
__metadata__ = sqlalchemy.MetaData()
__engine__ = sqlalchemy.create_engine("...')
__metadata__.engine = __engine__
setup_all()
create_all()

The above code was doing very good and didnt find any issues at all.

Can you please help how to do the same in TG2? turbogears.database is
not available anymore.

With Regards,
Dinesh.

--
You received this message because you are subscribed to the Google
Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to turbogears+unsubscr...@googlegroups.com
.
To post to this group, send email to turbogears@googlegroups.com
.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.


[TurboGears] elixir with turbogears2

2017-05-04 Thread D R Dinesh Kumar
Hi All,

We were using Elixir with TG1 and we have recently migrated to TG2.
Finding difficulty in hooking the TG2 session to Elixir session and 
metadata. 

we were using the following statement in TG1 for the hook:
from turbogears.database import metadata as __metadata__
from elixir import sqlalchemy
__metadata__ = sqlalchemy.MetaData()
__engine__ = sqlalchemy.create_engine("...')
__metadata__.engine = __engine__
setup_all()
create_all()

The above code was doing very good and didnt find any issues at all.

Can you please help how to do the same in TG2? turbogears.database is not 
available anymore.

With Regards,
Dinesh.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to turbogears+unsubscr...@googlegroups.com.
To post to this group, send email to turbogears@googlegroups.com.
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.