[sqlalchemy] Getting default value from python object

2017-10-25 Thread sqlalchemy_mysql
I understand default value is used to emit Insert statement. Is there any way to have default value is accessible via python object. See below example >>> class User(Base): ... __tablename__ = 'users' ... id = Column(Integer, primary_key=True) ... name = Column(String) ...

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Mike Bayer
On Wed, Oct 25, 2017 at 9:25 AM, Антонио Антуан wrote: > As I said befire, sqlalchemy version: 1.0.19 and code is here: > https://gist.github.com/aCLr/113ac292c05bdb01e964d8e9884d6e5f I apologize, did not see that link. Use the execute_and_instances() implemenation from

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Антонио Антуан
As I said befire, sqlalchemy version: 1.0.19 and code is here: https://gist.github.com/aCLr/113ac292c05bdb01e964d8e9884d6e5f Currently I can't use another version. In that case, I think that here is the right decision: "Looks like I have to check if "_mapper_zero()" returns real mapper. Otherwise

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Mike Bayer
On Wed, Oct 25, 2017 at 6:52 AM, Антонио Антуан wrote: > Any news here? We would require a self-contained demonstration case that illustrates your error as well as complete information on what specific SQLAlchemy version you are targeting. As mentioned in a different reply,

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Mike Bayer
On Wed, Oct 25, 2017 at 8:02 AM, Антонио Антуан wrote: > Looks like I have to check if _mapper_zero() returns real mapper. _mapper_zero() in the 1.1 and 1.2 series will never return a non-mapper (see https://bitbucket.org/zzzeek/sqlalchemy/issues/3608). I would strongly

Re: [sqlalchemy] sqlalchemy.select().group_by(expr) doesn't use label of expression, while .order_by(expr) does

2017-10-25 Thread Mike Bayer
On Wed, Oct 25, 2017 at 8:55 AM, Gijs Molenaar wrote: > > > Op vrijdag 20 oktober 2017 19:11:56 UTC+2 schreef Mike Bayer: >> >> On Thu, Oct 19, 2017 at 4:25 AM, Gijs Molenaar >> wrote: >> > >> > >> > Op donderdag 19 oktober 2017 03:10:21 UTC+2 schreef

Re: [sqlalchemy] sqlalchemy.select().group_by(expr) doesn't use label of expression, while .order_by(expr) does

2017-10-25 Thread Gijs Molenaar
Op vrijdag 20 oktober 2017 19:11:56 UTC+2 schreef Mike Bayer: > > On Thu, Oct 19, 2017 at 4:25 AM, Gijs Molenaar > wrote: > > > > > > Op donderdag 19 oktober 2017 03:10:21 UTC+2 schreef Mike Bayer: > >> > >> On Wed, Oct 18, 2017 at 7:38 AM, Gijs Molenaar

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Simon King
This is complete guesswork - I haven't examined this code in detail so I could be wrong. Also, I don't know what version of SQLAlchemy you are using, so this may not apply. Session.connection takes separate "mapper" and "clause" parameters:

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Антонио Антуан
Looks like I have to check if _mapper_zero() returns real mapper. Otherwise I should pass None to "_connection_from_session()" as value of "mapper" argument. Right? ср, 25 окт. 2017 г. в 15:00, Антонио Антуан : > As I mentioned before, " group_getter>". > > ср, 25 окт. 2017

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Антонио Антуан
As I mentioned before, "". ср, 25 окт. 2017 г. в 14:19, Simon King : > What does self._mapper_zero() return in your > RoutingQuery._execute_and_instances method? > > Simon > > On Wed, Oct 25, 2017 at 11:52 AM, Антонио Антуан > wrote: > > Any news

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Simon King
What does self._mapper_zero() return in your RoutingQuery._execute_and_instances method? Simon On Wed, Oct 25, 2017 at 11:52 AM, Антонио Антуан wrote: > Any news here? > > суббота, 21 октября 2017 г., 18:42:47 UTC+3 пользователь Антонио Антуан > написал: >> >> I see that it

Re: [sqlalchemy] mapper existance checks possibly wrong

2017-10-25 Thread Антонио Антуан
Any news here? суббота, 21 октября 2017 г., 18:42:47 UTC+3 пользователь Антонио Антуан написал: > > I see that it is not happened when "bind" passed directly to > "sessionmaker" > > сб, 21 окт. 2017 г. в 18:33, Антонио Антуан : > >> >> >> пятница, 20 октября 2017 г.,