Python allows you to wrap most values in parentheses, which can cause some
confusion with single item tuples.
"search_fields" is meant to be a sequence of things, and ('blurb') is
actually equivalent to 'blurb', so what you've specified will be treated as
5 fields, namely 'b', 'l', 'u', 'r' and 'b'.
What you probably want is ('blurb',) - the comma indicates it's a tuple
with one item in it, not a string wrapped in parentheses as you have.
On Sun, Jun 29, 2014 at 7:52 PM, Jason Sheldon <[email protected]>
wrote:
> Hi
>
> I have a custom model
>
> which has a
>
> blurb = models.TextField(blank=True)
>
> field.
>
> I now added
> objects = SearchableManager()
> search_fields = ('blurb')
>
> When I do a search I get the error below?
>
>
>
> Request URL:/search/?q=black Django Version:1.6.5Exception Type:
> FieldErrorException Value:
>
>
> Cannot resolve keyword u'r' into field. Choices are: _meta_title, _order,
> blurb, carousel, carousel_image1, carousel_image2, carousel_image3, children,
> colourranges, content, content_model, created, description, expiry_date,
> feature_image, footercontent, gen_description, id, in_menus, in_sitemap,
> keywords, keywords_string, login_required, page_ptr, parent, publish_date,
> ranges, short_url, site, slug, status, title, titles, updated
>
> Exception
> Location:/venv/lib/python2.7/site-packages/django/db/models/sql/query.py
> in names_to_path, line 1283
>
>
> Does anyone know what could be the reason for this error?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
Stephen McDonald
http://jupo.org
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.