title: Django Haystack custom SearchView for pretty urls
body: <p>I'm trying to setup Django Haystack to search based on some pretty urls.  Here is my urlpatterns.</p>
  
  <pre><code>urlpatterns += patterns('',
      url(r'^search/$', SearchView(), 
          name='search_all',
      ),
      url(r'^search/(?P&lt;category&gt;\w+)/$', CategorySearchView(
              form_class=SearchForm,
          ), 
          name='search_category',
      ),
  )
  </code></pre>
  
  <p>My custom SearchView class looks like this:</p>
  
  <pre><code>class CategorySearchView(SearchView):
      def __name__(self):
          return "CategorySearchView"
  
      def __call__(self, request, category):
          self.category = category
          return super(CategorySearchView, self).__call__(request)
  
      def build_form(self, form_kwargs=None):
          data = None
          kwargs = {
              'load_all': self.load_all,
          }
          if form_kwargs:
              kwargs.update(form_kwargs)
  
          if len(self.request.GET):
              data = self.request.GET
  
          kwargs['searchqueryset'] = SearchQuerySet().models(self.category)
  
          return self.form_class(data, **kwargs)
  </code></pre>
  
  <p>I keep getting this error running the Django dev web server if I try and visit /search/Vendor/q=Microsoft</p>
  
  <pre><code>UserWarning: The model u'Vendor' is not registered for search.
    warnings.warn('The model %r is not registered for search.' % model)
  </code></pre>
  
  <p>And this on my page</p>
  
  <pre><code>The model being added to the query must derive from Model.
  </code></pre>
  
  <p>If I visit /search/q=Microsoft, it works fine.  Is there another way to accomplish this?</p>
  
  <p>Thanks for any pointers
  -Jay</p>