Hey Any Solution on this ?  
On Wednesday, September 15, 2010 4:53:26 AM UTC+5:30, Kenneth Gonsalves 
wrote:
>
> hi,
>
> I have installed haystack with xapian backend. My relevant code is like
> this:
>
> import haystack
> haystack.autodiscover()
>
> from haystack.indexes import *
> from haystack import site
> from web.models import Stock
>
> class StockIndex(RealTimeSearchIndex):
>     text = CharField(document=True, use_template=True)
>
>     stockist = CharField(model_attr='stockist')
>     location = CharField(model_attr='location')
>
>     def get_queryset(self):
>         return Stock.objects.all()
>
> site.register(Stock, StockIndex)
>
> but on runserver (python2.6, django-trunk, fedora12):
>
> [lawgon@xlquest clearplus]$ python manage.py
> runserver                                                          
> Traceback (most recent call
> last):                                                                     
>          
>   File "manage.py", line 11, in
> <module>                                                                   
>      
>
> execute_manager(settings)                                                 
>                                   
>   File
> "/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
> line 438, in execute_manager      
>
> utility.execute()                                                         
>                                   
>   File
> "/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
> line 379, in execute              
>
> self.fetch_command(subcommand).run_from_argv(self.argv)                   
>                                   
>   File
> "/usr/lib/python2.6/site-packages/django/core/management/base.py", line
> 191, in run_from_argv
>     self.execute(*args, **options.__dict__)
>   File
> "/usr/lib/python2.6/site-packages/django/core/management/base.py", line
> 209, in execute
>     translation.activate('en-us')
>   File
> "/usr/lib/python2.6/site-packages/django/utils/translation/__init__.py",
> line 66, in activate
>     return real_activate(language)
>   File "/usr/lib/python2.6/site-packages/django/utils/functional.py",
> line 55, in _curried
>     return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
>   File
> "/usr/lib/python2.6/site-packages/django/utils/translation/__init__.py",
> line 36, in delayed_loader
>     return getattr(trans, real_name)(*args, **kwargs)
>   File
> "/usr/lib/python2.6/site-packages/django/utils/translation/trans_real.py", 
> line 193, in activate
>     _active[currentThread()] = translation(language)
>   File
> "/usr/lib/python2.6/site-packages/django/utils/translation/trans_real.py", 
> line 176, in translation
>     default_translation = _fetch(settings.LANGUAGE_CODE)
>   File
> "/usr/lib/python2.6/site-packages/django/utils/translation/trans_real.py", 
> line 159, in _fetch
>     app = import_module(appname)
>   File "/usr/lib/python2.6/site-packages/django/utils/importlib.py",
> line 35, in import_module
>     __import__(name)
>   File "/usr/lib/python2.6/site-packages/haystack/__init__.py", line
> 124, in <module>
>     handle_registrations()
>   File "/usr/lib/python2.6/site-packages/haystack/__init__.py", line
> 121, in handle_registrations
>     search_sites_conf = __import__(settings.HAYSTACK_SITECONF)
>   File "/home/lawgon/clearplus/web/search_indexes.py", line 17, in
> <module>
>     site.register(Stock, StockIndex)
>   File "/usr/lib/python2.6/site-packages/haystack/sites.py", line 45, in
> register
>     raise AlreadyRegistered('The model %s is already registered' %
> model.__class__)
> haystack.exceptions.AlreadyRegistered: The model <class
> 'django.db.models.base.ModelBase'> is already registered
>
> -- 
> regards
> Kenneth Gonsalves
>
>

-- 
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/-/8jr3Jed1cVEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to