I couldn't get this to work :(

Path of least resistance was to just add the field data to self.description

On Monday, February 17, 2014 10:48:21 PM UTC-5, step 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.

Reply via email to