hi, when I change like this as you said:

        item = web.select('todo', where='id=$id', vars=locals())[0] #,
_test=True)
        print render.error(len(list(item)))
        return False

it returns 4 :'(
when I do not catch this results
and this page is blank...

On 10/6/07, ashok raavi <[EMAIL PROTECTED]> wrote:
>
>
>
> On 10/6/07, Ken <[EMAIL PROTECTED]> wrote:
> >
> >
> > hi, I had the same problem.
> > check the lenth of obj, is 1.
> > when the template file use $item.id
> > debugger reports the same infomation...
> > my code like this:
> > # code.py
> > ...
> >
> item = web.select('todo', where='id=$id', vars=locals())
>
>
> change the above line to
>
> item = web.select('todo', where='id=$id', vars=locals())[0]
>
> # when i check item's length , it is 1.
> > # sql like: select * from todo where id=15. in MYSQL, I checked, it is
> > ok
> > render.edit(item)
> > ...
> >
> > # templates/edit.html
> > $def with (item)
> > <form action="/item/$item.id/save/" method="post">
> > ...
> >
> > # http://127.0.0.1:8080/item/15/edit
> > <type 'exceptions.AttributeError'> at /item/15/edit
> > IterBetter instance has no attribute 'id'
> > ...
> >
> > 3Q
> >
> > On 8月20日, 上午1时53分, "Matteo Zandi" <[EMAIL PROTECTED]> wrote:
> > > On 8/12/07, polymath <[EMAIL PROTECTED] > wrote:
> > >
> > >
> > >
> > > > Is there a good way I can make the program do what I want it to?
> > >
> > > form.Validator("Already in table",
> > >     lambda x: len(web.query("SELECT name FROM int_words WHERE
> > name='%s'" %
> > > x)) == 0)
> > > )
> > >
> > > I use this validator and it works.
> > >
> > > Matteo
> >
> >
> >
> >
> >
>
>
> --
> ashok raavi
> >
>


-- 
我走到一个陌生的地方, 告诉别人 我要去流浪
哦,我要去疗伤……

Gtalk: iexper(at)gmail.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to