I have a company model which relates to a product model 1-> M.
My goal is to search both models and return a result set set that will
show the company name and product name that are results of the query.
The implementation below only shows the company name.
1. Can I send back the product as well
Thanks. Sounds like a good idea! I will give it try!
On Sun, Sep 28, 2008 at 5:54 PM, Erik Allik <[EMAIL PROTECTED]> wrote:
> Since a Company could have multiple Products, it's not really possible to
> show the product as well with the way you do the querying.
> I would instead do a search on the
Since a Company could have multiple Products, it's not really possible
to show the product as well with the way you do the querying.
I would instead do a search on the Product model and then simply
iterate over the resulting products displaying the company for each of
them, too:
def search(
If anyone could have a look it would be much appreciated.
-Tom
On Sat, Sep 27, 2008 at 6:40 PM, Tom MacKenzie <[EMAIL PROTECTED]>wrote:
> http://django.pastebin.com/d1c579dbf
>
> Thanks!
>
>
> On Sat, Sep 27, 2008 at 5:48 PM, Ovnicraft <[EMAIL PROTECTED]> wrote:
>
>> is posible use pastebin? htt
http://django.pastebin.com/d1c579dbf
Thanks!
On Sat, Sep 27, 2008 at 5:48 PM, Ovnicraft <[EMAIL PROTECTED]> wrote:
> is posible use pastebin? http://django.pastebin.com/
>
> 2008/9/27 [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
>>
>> my view is below.
>>
>>
>>
>>Search{% if query %} Results{%
is posible use pastebin? http://django.pastebin.com/
2008/9/27 [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
> my view is below.
>
>
>
>Search{% if query %} Results{% endif %}
>
>
> Search
>
>Search:
>
>
>
>
> {% if query %}
>Results for "{{ query|escape }}":
>
>{% i
my view is below.
Search{% if query %} Results{% endif %}
Search
Search:
{% if query %}
Results for "{{ query|escape }}":
{% if results %}
{% for company in results %}
{{ company|escape }}
{% endfor %}
{% else %}
7 matches
Mail list logo