instead of

  record=db.table[id]

you can now do

  record=db.table(id)

the difference is that the former may return a exception if id is a
string of a field object if id contains a field name. The latter
always returns a record or None.

The latter also allows you to filter the one record by other fields
values.

  record=db.table(id,active=True)

(assuming db.table.active is a boolean). Returns the record or None if
the record with id has id==False.


On Aug 5, 4:15 pm, yamandu <[email protected]> wrote:
> I din´t understand:
>
> - new db.table(id,[field=value]) and db.table(query) syntax to get
> first matching record
>
> On Aug 4, 9:33 pm, Bruno Rocha <[email protected]> wrote:
>
> > Found it:http://web2py.com/examples/default/version
>
> > Tks
>
> > 2010/8/4 Bruno Rocha <[email protected]>
>
> > > LOL
>
> > > Really sorry when I read the thread mentioned above got the number on the
> > > head, I even mentioned as being the current version on my site. (just
> > > corrected)
>
> > > web2py use a crawler to pull the version information directly to the
> > > appadmin. it is possible to embed in any other place?
>
> > > I i'll take a look into appadmin source now.
>
> > > Sry...
>
> > > 2010/8/4 mdipierro <[email protected]>
>
> > >> You had me panic for a second. LOL
>
> > >> On Aug 4, 7:11 pm, Bruno Rocha <[email protected]> wrote:
> > >> > I got confused because of this thread..
> > >>http://groups.google.com/group/web2py/browse_thread/thread/a1e2b8443a...
> > >> > *1.84*#5e20279c2ba66d88
>
> > >> > Sorry...
>
> > >> > 2010/8/4 Bruno Rocha <[email protected]>
>
> > >> > > It is going down to zero ??
>
> > >> > > was 1.84.1, than 1.85. and now it is 1.82???
>
> > >> > > 2010/8/4 mdipierro <[email protected]>
>
> > >> > > Changelog
>
> > >> > >> #1.82.1
> > >> > >> - new template system supports {{block}}, thanks Thadeus
> > >> > >> - new db.table(id,[field=value]) and db.table(query) syntax to get
> > >> > >> first matching record
> > >> > >> - URL('index') (no more r=request), thanks Thadeus
> > >> > >> - mail.send(message='<html>...</html>', ....)
> > >> > >> - DAL([uri1, uri2, uri3]) for load balancing
> > >> > >> - @service.soap(...) with mysimplesoap, thanks Mariano
> > >> > >> - request.ajax to detect if action is called via ajax, tahnks
> > >> Jonathan
> > >> > >> and David Mako
> > >> > >> - more captcha options, thanks Vidul
> > >> > >> - openid and oauth2 thanks Michele and Keith
> > >> > >> - better PluginManager and load components
> > >> > >> - FORM(...,hideerror=True) for custom forms
>
> > >> > > --
>
> > >> > >http://rochacbruno.com.br
>
> > >> > --
>
> > >> >http://rochacbruno.com.br
>
> > > --
>
> > >http://rochacbruno.com.br
>
> > --
>
> >http://rochacbruno.com.br

Reply via email to