Hi again.
I tryed to use my "POST" from the site before as a variable of the view 
from page 2. Here you can see my 2 pages and the views...:
 
page one "portal.html"--------------------------------------------
 
{% include "header.html" %}
<title>Kunde</title>
{% include "header2.html" %}
<h1>Kunde</h1>
{% block content %}<p>Zeit der Aktualisierung {{ current_date }}</p>{% 
endblock %}
<form method="post" action="/kundendaten/">
    {% csrf_token %}
        <p>Bitte Kundennamen eingeben</p>
        <label>
            <input type="text" name="kunde" size="30" required="required">
        </label>
        <br>
        <br>
        <input type="submit" name="senden" value="Senden" 
href="kundendaten">

</form>
----------------------------------------------------------------------------
 
page 2 "kundendaten.html"----------------------------------------
 
{% include "header.html" %}
<title>Kundendaten</title>
{% include "header2.html" %}
<h1>Portal</h1>
<h2>Ausgabe Kundendaten</h2>
{% block content1 %}<p>Zeit der Aktualisierung {{ current_date }}</p>{% 
endblock %}
{% block content2 %}<p>Kundendaten {{ row }}.</p>{% endblock %}
<table border="1">
    <tr><th>Name</th><th>E-Mail</th></tr>
    <tr><td></td><td></td></tr>
</table>
{% include "footer.html" %}
------------------------------------------------------------------------------
 
views.py-------------------------------------------------------------------
 
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_protect
import datetime
import pyodbc
@csrf_protect
def portal(request):
    now = datetime.datetime.now()
    return render_to_response('portal.html', {'current_date': now}, 
context_instance=RequestContext(request))
def kundendaten(request):
    cnxn = pyodbc.connect('DRIVER={SQL 
Server};SERVER=MAURITIUS;DATABASE=***;UID=portal;PWD=*****')
    cursor = cnxn.cursor()
    cursor.execute("SELECT x.t_name, y.t_mail FROM tttaad200000 as x, 
tttcmf200000 as y WHERE (x.t_name = y.t_name) AND (x.t_user = 'HERE')")
    row = cursor.fetchall()
    now = datetime.datetime.now()
    return render_to_response("kundendaten.html", { 'row': 
row,'current_date': now}, context_instance=RequestContext(request))
----------------------------------------------------------------------
 
you can see in my views this (x.t_user = 'HERE')... this "HERE" must be a 
variable, the value have to be this POST from page one. can anyone help me 
there?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/N42xRanxSb4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to