On Thu, 14 Sep 2006 11:27:26 -0400
Michael Bayer <[EMAIL PROTECTED]> wrote:

> youre doing a SQL query, which is not directly compatible with the  
> querying method provided off of an ORM Query object (we differ from  
> Hibernate in that regard, which is somehow able to mix them all  
> together).
> 
> you probably want to use the Table directly and do:
> 
> self.plan.select 
> ([self.plan.c.month,self.plan.c.instrument_id,func.count 
> (self.plan.c.instrument_id)],
> and_(self.plan.c.year==int(year), self.plan.c.data.ilike('%%%s%%' %
> project)), group_by=[self.plan.c.month, self.plan.c.instrument_id])
> 
> 

Sorry, I didn't wrote it, but I tried also this method with the same
error.

File "webnmr_sqlalchemy_psql.py", line 1804, in calcstat
    group_by=[self.plan.c.month, self.plan.c.instrument_id])
TypeError: select() takes at most 2 non-keyword arguments (3 given)


> On Sep 14, 2006, at 9:43 AM, Enrico Morelli wrote:
> 
> > Dear all,
> >
> > there is some syntax error in the following select?
> >
> > results =
> > self.mysession.query(PlanEntry).select 
> > ([self.plan.c.month,self.plan.c.instrument_id,func.count 
> > (self.plan.c.instrument_id)],
> > and_(self.plan.c.year==int(year), self.plan.c.data.ilike('%%%s%%' %
> > project)), group_by=[self.plan.c.month, self.plan.c.instrument_id])
> >
> > I think yes, because I receive the following error:
> >
> >  group_by=[self.plan.c.month, self.plan.c.instrument_id])
> > TypeError: select() takes at most 2 non-keyword arguments (3 given)
> >
> > The group_by method isn't the same 'GROUP BY' SQL statement?
> >
> > Thanks
> >
> > -- 
> > -------------------------------------------------------------------
> >        (o_
> > (o_    //\  Coltivate Linux che tanto Windows si pianta da solo.
> > (/)_   V_/_
> > +------------------------------------------------------------------+
> > |     ENRICO MORELLI         |  email: [EMAIL PROTECTED]       |
> > | *     *       *       *    |  phone: +39 055 4574269             |
> > |  University of Florence    |  fax  : +39 055 4574253             |
> > |  CERM - via Sacconi, 6 -  50019 Sesto Fiorentino (FI) - ITALY    |
> > +------------------------------------------------------------------+
> >
> > ---------------------------------------------------------------------- 
> > ---
> > Using Tomcat but need to do more? Need to support web services,  
> > security?
> > Get stuff done quickly with pre-integrated technology to make your  
> > job easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> > Geronimo
> > http://sel.as-us.falkag.net/sel? 
> > cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Sqlalchemy-users mailing list
> > Sqlalchemy-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services,
> security? Get stuff done quickly with pre-integrated technology to
> make your job easier Download IBM WebSphere Application Server
> v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________ Sqlalchemy-users
> mailing list Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


-- 
-------------------------------------------------------------------
       (o_
(o_    //\  Coltivate Linux che tanto Windows si pianta da solo.
(/)_   V_/_
+------------------------------------------------------------------+
|     ENRICO MORELLI         |  email: [EMAIL PROTECTED]       |
| *     *       *       *    |  phone: +39 055 4574269             |
|  University of Florence    |  fax  : +39 055 4574253             |
|  CERM - via Sacconi, 6 -  50019 Sesto Fiorentino (FI) - ITALY    |
+------------------------------------------------------------------+

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to