Hello,

Could anyone please provide a working example on django-search-lucene? I 
have been going through this 
tutorial<https://code.google.com/p/django-search-lucene/wiki/UseDSLInYourDdjangoApps>,
 
but ending up with an error while trying to search:

type object 'Document' has no attribute 'objects_search'

 Request Method: GET  Request URL: 
http://127.0.0.1:8000/app/search/?query=d&submit=Search  Django Version: 
1.2.1  Exception Type: AttributeError  Exception Value: 

type object 'Document' has no attribute 'objects_search'

 Exception Location: /home/user/codes/project/app/views.py in search, line 
24  Python Executable: /usr/bin/python  Python Version: 2.6.5
Django version is 1.2.1. The models.py contains:

from django.db import models
from search import manager

class Document(models.Model):
    class Admin(models.Model):
        pass
        
    title = models.URLField(max_length=300, blank=False, null=False, )
    content = models.URLField(max_length=300, blank=False, null=False, )
    time_added = models.DateTimeField(auto_now_add=True, )
    path = models.FilePathField(blank=False, null=False, )
    objects = models.Manager()
    objects_search =  manager.Manager()  # add search manager

    def __unicode__(self):
        return "%s" % self.title

Thank you!

-- 
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/-/QPk1HxrXiUwJ.
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