elif alternative

Chris Rebert clp2 at rebertia.com
Thu Sep 17 20:11:30 EDT 2009


On Thu, Sep 17, 2009 at 5:03 PM, gert <gert.cuykens at gmail.com> wrote:
<snip>
> So far i have this
> http://code.google.com/p/appwsgi/source/browse/appwsgi/wsgi/appointment.wsgi
>
> I have 3 problems left Any_GID, Everybody_no_GID,

Just add entries to the dictionary with the same function as value but
all permutations of GID as part of their keys?

> and when no key
> found do return

try:
    func[(v['cmd'], s.GID)](db, v, s.UID, s.GID)
except KeyError:
    return text(response,'{"error":"session expired"}')

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list