[sqlalchemy] Re: session.add() neglecting some of my objects to be added

2017-07-12 Thread David Laredo Razo
Sorry I made a mistake, when printing whats inside the session I do it this way for new_object in session.new: print(new_object, mapper.identity_key_from_instance(new_object)) On Wednesday, July 12, 2017 at 11:31:06 PM UTC-5, David Laredo Razo wrote: > > Hello, I am using SQLAlchemy version

[sqlalchemy] session.add() neglecting some of my objects to be added

2017-07-12 Thread David Laredo Razo
Hello, I am using SQLAlchemy version 1.2.0b1 I created some mapped objects using the declarative style in SQLAlchemy. I have a mapping called ThermafuserReading which has a composed primary key made up of the Time_stamp column which is DateTime and ThermafuserId column which is an Integer and

Re: [sqlalchemy] Re: SQLAlchemy 1.2.0b1 released

2017-07-12 Thread Mike Bayer
this is how that would have to be mapped, hypothetically: class EngineerBase(Person): __tablename__ = 'engineer' id = Column(ForeignKey('person.id'), primary_key=True) engineer_name = Column(String(30)) __mapper_args__ = { 'polymorphic_load': 'selectin' } class

Re: [sqlalchemy] Re: SQLAlchemy 1.2.0b1 released

2017-07-12 Thread yoch . melka
Here a MCWE : from sqlalchemy import Table, Column, Integer, String, ForeignKey, create_engine from sqlalchemy.orm import Session from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Person(Base): __tablename__ = 'person' id = Column(Integer,

Re: [sqlalchemy] Re: SQLAlchemy 1.2.0b1 released

2017-07-12 Thread yoch . melka
I have a mixed configuration with both joined and single table subclasses in a two-levels inheritance (like that ), so selectin seems to be the right choice for me. Le jeudi 13 juillet 2017 01:09:50 UTC+3, Mike Bayer a écrit : > >

Re: [sqlalchemy] Re: SQLAlchemy 1.2.0b1 released

2017-07-12 Thread Mike Bayer
On Wed, Jul 12, 2017 at 4:54 PM, wrote: > I noticed that {'polymorphic_load': 'selectin'} on single table inheritance > can make several SQL queries unnecessarily. well "selectin" loading would be inappropriate for single table inheritance because you are telling it to

[sqlalchemy] Re: SQLAlchemy 1.2.0b1 released

2017-07-12 Thread yoch . melka
I noticed that {'polymorphic_load': 'selectin'} on single table inheritance can make several SQL queries unnecessarily. Le mercredi 12 juillet 2017 22:02:04 UTC+3, yoch@gmail.com a écrit : > > Very awaited version for me (because the selectin) ! > > I tested in my code both the eagerload and

[sqlalchemy] Re: SQLAlchemy 1.2.0b1 released

2017-07-12 Thread yoch . melka
Very awaited version for me (because the selectin) ! I tested in my code both the eagerload and the polymorphic usages, and everything works perfectly. Thank you Mike Le lundi 10 juillet 2017 16:44:03 UTC+3, Mike Bayer a écrit : > > SQLAlchemy release 1.2.0b1 is now available. > > This is the

[sqlalchemy] Re: SQLAlchemy and pymssql and cyrillic names of tables/columns

2017-07-12 Thread Belegnar Dragon
Everything works fine with freetds compiled at git master пятница, 18 апреля 2014 г., 16:06:30 UTC+4 пользователь Belegnar Dragon написал: > > Hello! > > Is it possible to handle with SQLAlchemy mssql database with cyrillic > table and column names? > > -- > WBR, > TO > > -- SQLAlchemy -