views:

51

answers:

0
from djangosphinx.models import SphinxSearch
def xx(request):
    queryset =File.search.query('test')
    #return HttpResponse(queryset)#<------1
    return render_to_response('a.html',{'a':queryset})#<--------2

and

class File(models.Model):
    name = models.CharField(max_length=200)
    tags = models.CharField(max_length=200) # We actually store tags for efficiency in tag,tag,tag format here

    objects = models.Manager()
    search  = SphinxSearch(index="test1")

a.html:

{% for i in a %}
    Some value: {{i}}
{% endfor %}