If the id is invalid
club=db(db.bedrijf.id==id).select
(db.bedrijf.bedrijfsnaam,db.bedrijf.kvk_nummer,db.bedrijf.subdossiernummer,db.bedrijf.status)
if club[0].status=='0': ...
you have a problem in the if statement. You need check (if club) else
you cannot call club[0]. The final check will not catch an error that
occurred before that line.
Massimo
On Jun 30, 1:15 pm, Joe Barnhart <[email protected]> wrote:
> But you can't execute this line:
>
> return dict(club=club[0],address=address[0],nfas=nfas)
>
> If either the club or the address is empty.
> Maybe you need something like:
>
> address=address or address[0]
>
> ...which will do a lazy evaluation of address[0] only if address
> exists.
> But then you have to test for None later when you use it in the view.
>
> On Jun 30, 11:08 am, annet <[email protected]> wrote:
>
> > I am not sure. I want to display the club, address or nfa details if
> > one or more of them contain(s) values.
>
> > if not (p or q or r): does exactly that.
> > not (0 or 0 or 0) evaluates to true in all other cases it evaluates to
> > false.
>
> > The other option would be to only display the details if club, address
> > and nfa all contain values
>
> > if (p and q and r) would accomplish that (1 and 1 and 1) evaluates to
> > true.
>
> > But that doesn't make any difference to the ticket being issued.
>
> > Kind regards,
>
> > Annet.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---