Massimo,

So, the rewritten function is correct?


Back to the logic:

not(p or q or r) is equivalent to: not p and not q and not r
(DeMorgans' theorem)


Duvo said I should use not p or not q or not r instead of not (p or q
or r) but in case not 1 or not 1 or not 1 this would result in 0 or 0
or 0 which evaluates to 0. So in case p, q and r all contain results
the results would not be displayed ... or am I wrong here?

I described my considerations in my previous post. If I am wrong, let
me know.


Joe,

I changed the function to read like:

def details():
    id=request.args[0]
    club=db(db.bedrijf.id==id).select
(db.bedrijf.bedrijfsnaam,db.bedrijf.kvk_nummer,\
    db.bedrijf.subdossiernummer,db.bedrijf.status)
    if not club:
        redirect(URL(r=request,c='default',f='index'))
    elif club[0].status=='0':
        redirect(URL(a='site',c='default',f='index',args=id))
    else:
        address=db((db.adres.bedrijf==id)&
(db.adres.adressoort==1)).select(db.adres.ALL)
        nfas=db((db.bedrijfnfa.bedrijf==id)&
(db.bedrijfnfa.nfatype==db.nfatype.id))\
        .select
(db.bedrijfnfa.nfatype,db.bedrijfnfa.adres,db.nfatype.nfatype,orderby=db.bedrijfnfa.nfatype)
    if not (club or address or nfas):
        redirect(URL(r=request,c='default',f='index'))
    return dict(club=club,address=address,nfas=nfas)


.. and  the view to read like:

{{extend 'coregeneric.html'}}

<div id="cld_page">
  <div id="cld_container">
    <div id="cld_header">
      <h1>{{=club[0].bedrijfsnaam}}</h1>
    </div> <!-- cld_header -->
    <div id="cld_contents">
      <div id="cld_leftcolumn">
        {{if address:}}
          <p>{{=address[0].straat}} {{=address[0].huisnummer}} {{if
address[0].huisnummerextensie:}}{{=address[0].huisnummerextensie}}
{{pass}}<br />
             {{=address[0].postcode_cijferdeel}} {{=address
[0].postcode_letterdeel}} {{=address[0].plaats}}</p>
        {{pass}}
      </div> <!-- cld_leftcolumn -->
      <div id="cld_rightcolumn">
        {{if nfas:}}
          <table>
            {{for nfa in nfas:}}
              {{c=nfa.nfatype.nfatype}}
              {{a=nfa.bedrijfnfa.adres}}
              {{if c=='T' or c=='F' or c=='M':}}
                <tr>
                  <td>{{=c}}: </td>
                  <td>{{=a}}</td>
                </tr>
              {{elif c=='E':}}
                <tr>
                  <td>{{=c}}: </td>
                  <td>{{=A(a,_href="mailto:"+a)}}</td>
                </tr>
              {{else:}}
                <tr>
                  <td>{{=c}}: </td>
                  <td>{{=A(a,_href="http://"+a)}}</td>
                </tr>
              {{pass}}
              {{pass}}
          </table>
        {{pass}}
      </div> <!-- cld_rightcolumn -->
    </div> <!-- cld_contents -->
    <div id= "cld_footer">
    </div> <!-- cld_footer -->
    <div id="closeWin">
      {{=INPUT(_type='button',_value='Venster
sluiten',_onclick="javascript:window.close()")}}
    </div> <!-- closeWin -->
  </div> <!-- cld_container -->
</div> <!-- cld_page -->


I hope this solves the problem your brought up.

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to