Ajout du header, modif de la view pour prendre une requete plus complete en compte.

This commit is contained in:
Fred 2012-06-13 21:46:27 +02:00
parent 85d5436712
commit 75db1afa32
5 changed files with 24 additions and 4 deletions

View File

@ -31,7 +31,21 @@ def query(request):
else:
terms = request.GET['q']
context = { 'cards_list' : None, 'title' : 'Recherche sur les termes : ' + terms }
from django.db import connection
cursor = connection.cursor()
for term in terms.split(' '):
pass
raw_sql = '%s shalalal %s'
for row in cursor.execute(raw_sql, ['%'+term+'%']):
print row.id
cards_list = query_set
context = { 'cards_list' : cards_list, 'title' : 'Recherche sur les termes : ' + terms }
return render_to_response('cards/list.html', RequestContext(request, context))

View File

@ -8,4 +8,10 @@
{
width: 95%;
margin: auto;
}
}
header img
{
margin: auto;
text-align: center;
}

BIN
static/img/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -11,7 +11,7 @@
</head>
<body>
<header class="jumbotron subhead" id="overview">
<p><a href="{% url index %}">No header</a></p>
<img src="{{STATIC_URL}}/img/header.png" alt="Ma collection de télécartes" />
</header>
<div class="container-fluid">
<div class="row-fluid">
@ -35,4 +35,4 @@
</footer>
</body>
</html>
</html>

View File