[sqlalchemy] SQLAlchemy and PyQT5

2017-06-02 Thread Wayne
Hi, Does anyone have any experience, links to open source code or anything else that shows the integration of PyQT5 with SQLAlchemy? Thanks Wayne -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE

[sqlalchemy] Applying an aggregate function to a select of a union_all (expr lang)

2009-07-02 Thread Wayne Witzel
or missing the obvious? Thanks, Wayne Here is the SQL I hand crafted before I started building the expr repr. select id, name, sum(cnt) as total from ( (select count(*) as cnt, groupname as name, invgroups.groupid as id from invgroups join invtypes

[sqlalchemy] Re: Applying an aggregate function to a select of a union_all (expr lang)

2009-07-02 Thread Wayne Witzel
the result of the union of the count and literal columns in the outer select. Wayne On Jul 2, 11:39 am, Michael Bayer mike...@zzzcomputing.com wrote: Queb wrote: On Jul 2, 10:39 am, Michael Bayer mike...@zzzcomputing.com wrote: whats count() here, do you mean func.count('*') ? Sorry, yes, count

[sqlalchemy] Re: timestamp as int

2009-07-02 Thread Wayne Witzel
For mySQL you could use unix_timestamp() For Postgres you could use date_part('epoch',now()) I've always used DateTime personally and have only ever reflected tables that used Integer timestamps. So I can't speak to the drawbacks or potential impacts with any authority. There may also be a more

[sqlalchemy] Re: Applying an aggregate function to a select of a union_all (expr lang)

2009-07-02 Thread Wayne Witzel
) TT = s2.alias('TT') u = union_all(s1, TT) s = select([         u.c.id,         u.c.name,         func.sum(u.c.cnt).label('total')     ]).group_by(TT.c.name, TT.c.id).order_by(TT.c.name) print s Wayne Witzel wrote: Count needs to appear in the group by our be used in an aggregate

[sqlalchemy] declarative and __table_args__ I must be missing something simple.

2009-04-08 Thread Wayne Witzel
I assume I am over looking some simple thing, but I just can't seem to find it. Thanks for the assist, I have palms open ready for face planting. Using a class and table with orm.mapper() class Child(object): pass child_table = Table('child', meta.metadata, Column('parent_id',

[sqlalchemy] Re: declarative and __table_args__ I must be missing something simple.

2009-04-08 Thread Wayne Witzel
']), {}) Now all is well, sorry for the ML clutter. I am face palming in 3, 2, 1 On Apr 8, 4:49 pm, Wayne Witzel wwitz...@gmail.com wrote: I assume I am over looking some simple thing, but I just can't seem to find it. Thanks for the assist, I have palms open ready for face planting. Using

[sqlalchemy] Re: Is this a transaction?

2008-10-15 Thread Wayne Witzel
On Oct 15, 11:37 am, Heston James - Cold Beans [EMAIL PROTECTED] wrote: Quick question I hope guys. If I have an object which contains a bunch of children and cascade is set on the relationships. When I add the parent object to the session and commit it, are the children saved as part of a

[sqlalchemy] Re: in_( bindparam(list) ) ?

2008-10-13 Thread Wayne Witzel
: '_BindParamClause' object is not iterable is this possible or not ? or sending a list/tuple/iterable as bindparam-value is not supported? ciao svil Just wrap your bindparam with brackets. Wayne --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: in_( bindparam(list) ) ?

2008-10-13 Thread Wayne Witzel
be x.in_([bindparam('somename')]) I have to turn off the caching proxy for this group, you reply too fast. Wayne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

[sqlalchemy] subselect and auto-correlate issue (0.5rc1)

2008-10-09 Thread Wayne Witzel
I have the following code: tags = [utag1, utag2] tag_count = len(tags) inner_q = select([shiptag_table.c.shipid]) inner_w = inner_q.where( and_(shiptag_table.c.tagid == Tag.id,Tag.name.in_(tags))

[sqlalchemy] Re: subselect and auto-correlate issue (0.5rc1)

2008-10-09 Thread Wayne Witzel
On Oct 9, 10:20 am, Wayne Witzel [EMAIL PROTECTED] wrote: I have the following code:         tags = [utag1, utag2]         tag_count = len(tags)         inner_q = select([shiptag_table.c.shipid])         inner_w = inner_q.where(             and_(shiptag_table.c.tagid == Tag.id

[sqlalchemy] Re: subselect and auto-correlate issue (0.5rc1)

2008-10-09 Thread Wayne Witzel
not really   clear what statement you're going for...). Yeah, this was exactly what was happening, I turned off the auto-correlation for the inner_q and got the desired output SQL and results. Thanks Michael Thanks, Wayne --~--~-~--~~~---~--~~ You received this message