viewes.py

from Mysitez.models import AutoParsingMan from django.shortcuts import render_to_response from django.http import HttpResponse def search(request): if 'q' in request.GET and request.GET['q']: q = request.GET['q'] list = AutoParsingMan.objects.filter(marka__icontains=q) return render_to_response('Mysitez/seach.html', {'list': list, 'querty': q}) else: return HttpResponse('Please submit a search term.') 

seach.html

 {% extends 'Mysitez/base.html' %} <p>You searched for: <strong>{{ query }}</strong></p> {% if list %} <ul> {% for AutoParsingMan in list %} <li>{{ AutoParsingMan.marka }}</li> {% endfor %} </ul> {% else %} <p>No marks matched your search criteria.</p> {% endif %} 

models.py

  from django.db import models as m class AutoParsingMan(m.Model): date_ins = m.DateTimeField() date_change = m.DateTimeField() change = m.CharField(max_length=15) date = m.DateTimeField() date_task = m.DateField() marka = m.CharField(max_length=50) class Meta: managed = False db_table = 'auto_parsing_man' 

base and columns are available by incpectdb

ok - removed the extension of the base template

start displaying a list of points, the filter is working and something is displayed

I will change a question - how to make that the normal data was issued?

    1 answer 1

    Try adding to model

     def __str__(self): return self.marka