Re: [sqlalchemy] Bug with bidirectional association proxy many-to-many relationships reintroduced?

2016-08-24 Thread Mike Bayer
On 08/24/2016 03:09 PM, Gordan Todorovac wrote: Mike, python -i ~/python/sq3.py from sqlalchemy import create_engine from sqlalchemy.orm import Session e = create_engine("sqlite:///:memory:") Base.metadata.drop_all(e) Base.metadata.create_all(e) session=Session(e) rory=User("rory") session.

Re: [sqlalchemy] begin_nested 2 Table

2016-08-24 Thread lone ois
OK, you code is right. i am fool. my project table has own data conn class subtable and maintable get different session. so is my bug. Thank You. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving

Re: [sqlalchemy] Bug with bidirectional association proxy many-to-many relationships reintroduced?

2016-08-24 Thread Gordan Todorovac
Mike, Thanks for the response! Here is the demonstration, please let me know if there is something obvious that I am missing: > cat ~/python/sq3.py from sqlalchemy import Column, Integer, String, ForeignKey from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.associationproxy im

Re: [sqlalchemy] begin_nested 2 Table

2016-08-24 Thread Mike Bayer
On 08/24/2016 02:26 PM, lone ois wrote: M2 = SubTable() _conn.begin_nested() M1.mainkey - "1" MainTable has no attribute "mainkey" and I think this means to be an = sign. M2.number = '1' M2.name = '1' _conn.add(M2) _conn.commit() except: _conn.rollback() else: _conn.commit(

[sqlalchemy] begin_nested 2 Table

2016-08-24 Thread lone ois
Hello ALL: i has 2 table. _Table_Metadata = declarative_base(cls = DictableModel) class MainTable(_Table_Metadata): __tablename__ = 'MainTable' id = Column(BIGINT, primary_key = True, autoincrement = True, unique = True) number = Column(Text, unique=True, nullable=False) name

Re: [sqlalchemy] Bug with bidirectional association proxy many-to-many relationships reintroduced?

2016-08-24 Thread Mike Bayer
On 08/24/2016 08:59 AM, Gordan Todorovac wrote: Hi, all - I am experiencing the issue described here http://stackoverflow.com/questions/14470688/sqlalchemy-bidirectional-relationship-association-proxy and reported as fixed here https://bitbucket.org/zzzeek/sqlalchemy/issues/2655 in the la

[sqlalchemy] Bug with bidirectional association proxy many-to-many relationships reintroduced?

2016-08-24 Thread Gordan Todorovac
Hi, all - I am experiencing the issue described here http://stackoverflow.com/questions/14470688/sqlalchemy-bidirectional-relationship-association-proxy and reported as fixed here https://bitbucket.org/zzzeek/sqlalchemy/issues/2655 in the latest release version of SQLAlchemy (1.0.14). Summary

Re: [sqlalchemy] Re: Abusing a string column as list of foreign keys (own relationship class, based on DependencyProcessor?)

2016-08-24 Thread Mike Bayer
On 08/24/2016 04:39 AM, Torsten Landschoff wrote: Hi all, On Wednesday, August 24, 2016 at 3:17:55 AM UTC+2, Torsten Landschoff wrote: I am currently pulling my hair out because I have a solution that I think should work on the database side (albeit I don't like it), but I can't f

[sqlalchemy] Re: Abusing a string column as list of foreign keys (own relationship class, based on DependencyProcessor?)

2016-08-24 Thread Torsten Landschoff
Hi all, On Wednesday, August 24, 2016 at 3:17:55 AM UTC+2, Torsten Landschoff wrote: > > I am currently pulling my hair out because I have a solution that I think > should work on the database side (albeit I don't like it), but I can't > figure out how to do this with sqlalchemy. > My current go

[sqlalchemy] Re: Having SA generate constructor when using autoload.

2016-08-24 Thread Piotr Dobrogost
> On Monday, August 22, 2016 at 11:12:11 AM UTC+2, Piotr Dobrogost wrote: > > (...) > Is there a way to hold off this check until after I map this class like this > > my_table = sa.Table("my_table", meta.metadata, autoload=True, autoload_with=engine) > orm.mapper(MyClass, my_table) > > ? It appe

Re: [sqlalchemy] hybrid_property vs. hybrid_method, other than the latter can take arguments?

2016-08-24 Thread Simon King
On Wed, Aug 24, 2016 at 2:55 AM, Jinghui Niu wrote: > Hi, I wonder if there is any recommendation or best practice on choosing > between > hybrid_property > > and > hybrid_method > , > other than they hybrid_method can take arguments? If I use the hybrid_method > only throughout, without giving it