Hello Oleg,

sorry for the late answer, i was away for some time. I really appreciate
your help!

1) When i define the function like this:

    @classmethod
    def select(cls, **kw):
        sresult = SQLObject.select(cls, **kw)
        return sresult.filter(~ LIKE(Reisen.q.REISENR, "BUS%"))

and then do sth. like
Reisen.select(Reisen.q.REISENR == "08LLO/0815")
i get
TypeError: select() takes exactly 1 argument (2 given)

if i do
Reisen.select(clause = Reisen.q.REISENR == "08LLO/0815")
i get
TypeError: select() got multiple values for keyword argument 'clause'


2) if i define it like this
    @classmethod
    def select(cls, clause=None, **kw):
        sresult = SQLObject.select(cls, clause, **kw)
        return sresult.filter(~ LIKE(Reisen.q.REISENR, "BUS%"))

and try
Reisen.select(Reisen.q.REISENR == '08LLO/0815')
i get
File "/srv/www/Tag-der-Abrechnung/tagderabrechnung/ratio.py", line 163, in
select
    sresult = SQLObject.select(cls, clause, **kw)
  File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.3-py2.4.egg/sqlobject/main.py",
line 1328, in select
    join=join, forUpdate=forUpdate)
  File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.3-py2.4.egg/sqlobject/sresults.py",
line 19, in __init__
    for table in clauseTables:
TypeError: iteration over non-sequence

and
Reisen.select(clause = Reisen.q.REISENR == '08LLO/0815')
leads to
File "/srv/www/Tag-der-Abrechnung/tagderabrechnung/ratio.py", line 163, in
select
    sresult = SQLObject.select(cls, clause, **kw)
  File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.3-py2.4.egg/sqlobject/main.py",
line 1328, in select
    join=join, forUpdate=forUpdate)
  File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.3-py2.4.egg/sqlobject/sresults.py",
line 19, in __init__
    for table in clauseTables:
TypeError: iteration over non-sequence


i think i now have all possible combinations of what you suggested?

Hope you know an answer?

Thanks and regards,

Frank



On Jan 17, 2008 8:39 PM, Oleg Broytmann <[EMAIL PROTECTED]> wrote:

> On Thu, Jan 17, 2008 at 08:30:26PM +0100, Frank Wagner wrote:
> > @classmethod
> >     def select(cls, clause=None, **kw):
> >
> > but no matter what i try, it always produces errors.
>
>   What errors? SyntaxError?
>
>    @classmethod
>    def select(cls, clause=None, **kw):
>
> ^^^^ Indent!
>
> Oleg.
> --
>     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
>           Programmers don't die, they just GOSUB without RETURN.
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to