Don't hoard your tracebacks, set them out free into the world!

(please paste your full tracebacks somewhere)


On Tue, Feb 18, 2014 at 2:48 PM, step <[email protected]> wrote:

> Hey guys, I can't figure this out.  I figured this might be something
> worth resolving on the mailing list as a reference.
> I'm trying to use a foreignkey in a Model's search_fields (search using a
> foreignkey).
>
> Anyone have any idea?
>
> *settings.py*
> -----
> (
>     # Dotted path to field.
>     "cartridge.shop.models.Product.artist",
>     # Dotted path to field class.
>     "ForeignKey",
>     # Positional args for field class.
>     ("app.Artist",),
>     # Keyword args for field class.
>     {"blank": False},
> )
>
> *OPTION 1.*
>
> patches.py
> ----
> Product.search_fields = {'keywords_string': 10, 'title': 5, 'artist': 5}
>
> results in
> ----
> "Related Field got invalid lookup: icontains"
>
>
> *OPTION 2*
>
> patches.py
> ----
> Product.search_fields = {'keywords_string': 10, 'title': 5,
> 'artist__title': 5}
>
> results in
> ----
> "'Product' object has no attribute 'artist__title'"
>
> --
> 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/groups/opt_out.
>



-- 
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/groups/opt_out.

Reply via email to