Python Appengine Consult Data
<p>good evening,
i'm working  in a experimental site, and it's my first project. I need some help to achieve what I intend. I'm using five classes, Processo, Empreiteiro, Proprietário, Requerente and Consulta, all of them in diferent webpages. In the first four, I have forms where I insert, edit, delete and show the data that I inserted. In classe Consulta I just intend to show , in a table, some of the inserted data in the previous classes. The problem is, when I open the Consulta webpage it shows me the data that I have called from the other classes but in diferent lines, when I want to join all of them in just one line. It's that possible? here's some code... Thanks for your help. </p>

<pre><code>class Consulta(polymodel.PolyModel):     
local_da_obra = db.StringProperty() 
freguesia = db.StringProperty()
concelho = db.StringProperty()      
codigo_postal = db.StringProperty()
numero_processo = db.StringProperty()
data_registo = db.StringProperty()
bi = db.StringProperty()
created = db.DateTimeProperty(auto_now_add=True)


class Processo(Consulta):     
numero_conservatoria = db.StringProperty()     
numero_registo = db.StringProperty()
tecnico = db.StringProperty()   
numero_tecnico = db.StringProperty()
telefone_tecnico = db.StringProperty()


class Requerente(Consulta):
nome_req = db.StringProperty()
morada_req = db.StringProperty()
freguesia_req = db.StringProperty()
concelho_req = db.StringProperty()
codigo_postal_req = db.StringProperty()
telefone_req = db.StringProperty()
telemovel_req = db.StringProperty()
nif_req = db.StringProperty()
bi_req = db.StringProperty()
email_req = db.StringProperty() 

class Proprietario(Consulta):
nome_prop = db.StringProperty()
morada_prop = db.StringProperty()
freguesia_prop = db.StringProperty()
concelho_prop = db.StringProperty()
codigo_postal_prop = db.StringProperty()
telefone_prop = db.StringProperty()
telemovel_prop = db.StringProperty()
nif_prop = db.StringProperty()
bi_prop = db.StringProperty()
email_prop = db.StringProperty()

class Empreiteiro(Consulta):
empresa = db.StringProperty()
morada_emp = db.StringProperty()
freguesia_emp = db.StringProperty()
concelho_emp = db.StringProperty()
codigo_postal_emp = db.StringProperty()
telefone_emp = db.StringProperty()
telemovel_emp = db.StringProperty()
nif_emp = db.StringProperty()
alvara_emp = db.StringProperty()
email_emp = db.StringProperty() 


class ListaConsultasPage(webapp.RequestHandler):
def get(self):
    user = users.get_current_user()
    url = users.create_login_url(self.request.uri)
    url_linktext = 'Login'
    # para o caso de estar logado
    if users.get_current_user():
        url = users.create_logout_url(self.request.uri)
        url_linktext = 'Logout'

    consultas_query = Consulta.all()
    consultas = consultas_query.fetch(99999)

    values = {
        'consultas': consultas,
        'numConsultas' : len(consultas), 
        'user': user,
        'url': url,
        'url_linktext': url_linktext,
    }

    path = os.path.join(os.path.dirname(__file__), 'listaConsultas.html')
    self.response.out.write(template.render(path, values))
</code></pre>

<p>In Consulta Webpage I have:</p>

<pre><code>{% block main %}
&lt;h3&gt;Consulta de Processos&lt;/h3&gt;
&lt;p&gt;&lt;a style="font-style:italic" href="/"&gt;Início&lt;/a&gt;&lt;/p&gt;
&lt;table width="900" border="1"&gt;
    {% if numConsultas %}
      &lt;tr&gt;
        &lt;td width="225"&gt;Número Processo&lt;/td&gt;
        &lt;td width="225"&gt;Local da Obra&lt;/td&gt;
        &lt;td width="225"&gt;Nome do Requerente&lt;/td&gt;
        &lt;td width="225"&gt;Nome do Proprietário&lt;/td&gt;
        &lt;td width="225"&gt;Empreiteiro&lt;/td&gt;
        &lt;td width="225"&gt;Técnico Responsável&lt;/td&gt;
        &lt;td width="225"&gt;Contactos&lt;/td&gt;
      &lt;/tr&gt;
        {% for consulta in consultas %}
      &lt;tr&gt;
        &lt;td&gt;{{ consulta.numero_processo }}&lt;/a&gt;&lt;/td&gt;
        &lt;td&gt;{{ consulta.local_da_obra}}&lt;/td&gt;
        &lt;td&gt;{{ consulta.nome_req }}&lt;/td&gt;
        &lt;td&gt;{{ consulta.nome_prop }}&lt;/td&gt;
        &lt;td&gt;{{ consulta.empresa }}&lt;/td&gt;
        &lt;td&gt;{{ consulta.tecnico }}&lt;/td&gt;
        &lt;td&gt;{{ consulta.telefone_req }}&lt;/td&gt;

      &lt;/tr&gt;
    {% endfor %}
    {% else %}
    &lt;tr&gt;
    &lt;td colspan="7"&gt;
      Nao existem registos a apresentar.&lt;/td&gt;
    &lt;/tr&gt;
    {% endif %}
&lt;/table&gt;
{% endblock %}
</code></pre>

<p>Thanks for your patience...</p>
