Re: Can't explain this ImportError

2010-02-25 Thread Daniel Roseman
On Feb 25, 6:27 am, Adam Yee  wrote:
> Just started using haystack.  I've created an extended search form of
> SearchForm and have it located at /mysite/search/search_forms.py
>
> The import error happens in haystack.urls
>
> Traceback:
> File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
> django/core/handlers/base.py" in get_response
>   92.                         request.path_info)
> File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
> django/core/urlresolvers.py" in resolve
>   222.                     sub_match = pattern.resolve(new_path)
> File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
> django/core/urlresolvers.py" in resolve
>   220.             for pattern in self.url_patterns:
> File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
> django/core/urlresolvers.py" in _get_url_patterns
>   249.         patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
> File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
> django/core/urlresolvers.py" in _get_urlconf_module
>   244.             self._urlconf_module =
> import_module(self.urlconf_name)
> File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
> django/utils/importlib.py" in import_module
>   35.     __import__(name)
> File "/home/adam/stldata-djangosvn-2.6/mysite/haystack/urls.py" in
> 
>   3. from mysite.search.search_forms import CustomerSearchForm
>
> Exception Type: ImportError at /search/serviceorder/
> Exception Value: No module named search.search_forms
>
> Here is mysite.haystack.urls:
>
> from django.conf.urls.defaults import *
> from haystack.views import SearchView
> from mysite.search.search_forms import CustomerSearchForm # <---
>
> urlpatterns = patterns('haystack.views',
>     url(r'^serviceorder/$', SearchView(), name='haystack_search'),
> )
>
> It should be working.  All that's been added is the directory 'search'
> containing 'search_forms.py'.
> Permissions shouldn't be an issue either.  It's all in my Python
> path...I have no clue.

The search directory needs an __init__.py.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



Can't explain this ImportError

2010-02-24 Thread Adam Yee
Just started using haystack.  I've created an extended search form of
SearchForm and have it located at /mysite/search/search_forms.py

The import error happens in haystack.urls

Traceback:
File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
django/core/handlers/base.py" in get_response
  92. request.path_info)
File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
django/core/urlresolvers.py" in resolve
  222. sub_match = pattern.resolve(new_path)
File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
django/core/urlresolvers.py" in resolve
  220. for pattern in self.url_patterns:
File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
django/core/urlresolvers.py" in _get_url_patterns
  249. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
django/core/urlresolvers.py" in _get_urlconf_module
  244. self._urlconf_module =
import_module(self.urlconf_name)
File "/home/adam/stldata-djangosvn-2.6/lib/python2.6/site-packages/
django/utils/importlib.py" in import_module
  35. __import__(name)
File "/home/adam/stldata-djangosvn-2.6/mysite/haystack/urls.py" in

  3. from mysite.search.search_forms import CustomerSearchForm

Exception Type: ImportError at /search/serviceorder/
Exception Value: No module named search.search_forms

Here is mysite.haystack.urls:

from django.conf.urls.defaults import *
from haystack.views import SearchView
from mysite.search.search_forms import CustomerSearchForm # <---

urlpatterns = patterns('haystack.views',
url(r'^serviceorder/$', SearchView(), name='haystack_search'),
)

It should be working.  All that's been added is the directory 'search'
containing 'search_forms.py'.
Permissions shouldn't be an issue either.  It's all in my Python
path...I have no clue.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.