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
<mailto:turbogears+unsubscr...@googlegroups.com>.
To post to this group, send email to turbogears@googlegroups.com
<mailto: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.

Reply via email to