Hello!!! I'm trying to make the code below work as follows.
When filling out the data entry, click on the query button.

# template/pac_recepx. jinja2

<div class="form">     
        <div class="row g-2 mt-3">      
            <h3><span class="font-semi-bold">Consultar cadastro do 
paciente</span></h3>
        </div>
        <form class="form-inline my-2 my-lg-0" 
action="http://localhost:6543/queryx"; method="GET">
            <label for="cpf">Digite o CPF (11 nĂºmeros)</label>
            <input class="form-control mr-sm-2" type="text" id="cpf" 
name="cpf" required maxlength="11" value=''>
            <button class="btn btn-outline-success my-2 my-sm-0" 
type="submit">Consultar</button>
        </form>
    </div>

In this view, using the code below, it shows all registered patients. 

@view_config(route_name='queryp', renderer=
'piprdc:templates/pac_query.jinja2')
def queryp(request):
   rows = request.dbsession.query(Paciente).all()
   pacientes=[]
   for row in rows:
      pacientes.append({"id":row.id, "name":row.name, "idade":row.idade, 
"data_nascimento":row.data_nascimento, "sexo":row.sexo, 
                        "raca":row.raca, "fone":row.fone, 
"endereco":row.endereco, 
"cpf":row.cpf, "cns":row.cns})
   return{'pacientes':pacientes} 

The question is, how do I make it show only the patient I requested the 
appointment with? I've looked at a lot of content, but I can't create a 
logic for it to take the past information (cpf), compare it and display it.

Every help is welcome.

Oberdan costa



-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/25b36bc3-0c71-4587-b79f-dfb26e83e7f7n%40googlegroups.com.

Reply via email to