>>> a=lambda b: 'c'

is the same as

   >>> def a(b): return 'c'

but often you see

   >>> def f(a): a()
   >>> f(lambda b: 'c')
   'c'

this means that within f, a=lambda b:'c' but outside f, the function
has no name. The function (lambda) exist only for the purposed to be
passed to f.


On Jun 9, 1:30 pm, Jason Brower <encomp...@gmail.com> wrote:
> Nice, I will try number one as I still don't know what the heck a lambda
> is.
> Best regards,
> Jason Brower
>
> On Wed, 2010-06-09 at 06:44 -0700, mdipierro wrote:
> > You have two options:
>
> > 1) perform 4 quesries
>
> > rows=db(query_first).select()+db(query_second).select()
> > +db(query_third).select()+db(query_others).select(orderby=criteria)
>
> > 2) perform one query and sort them in memoery
>
> > rows=db(...).select().sort(lambda row: yoursortingfunction(row))
>
> > On Jun 9, 5:38 am, Jason Brower <encomp...@gmail.com> wrote:
> > > I have a field in my database that I would like to order in a particular
> > > way.  It is string.
>
> > > Could I order the item by stating what should be first second third, and
> > > then the rest can be alphabetical.
> > > In particular.
> > > db.orders, orderby=db.orders.status
> > > That way I can get all the "Completed" and the second could be "At the
> > > door" and so on?
> > > BR,
> > > Jason Brower

Reply via email to