[i.fields for i in self.ingredients.objects.all()]
fields is you method __str__ back, try comments __str__ method in model
Ingredients

or this function get_ingredient create in admin files and used obj parameter

cheers

On Tue, Apr 3, 2018 at 10:34 AM, Muhammad bin-haneef <[email protected]>
wrote:

> kindly share the code where you registered your product for admin site and
> you are calling "get_ ingredients()" method.
>
> As the error shows your method needs 2 arguments to pass when you call
> "get_ingredients()".
>
> On Tue, Apr 3, 2018 at 12:05 PM, mansi thakkar <[email protected]>
> wrote:
>
>> It is there in ProductIngredient.png.
>>
>> On Tuesday, April 3, 2018 at 11:57:38 AM UTC-4, squal poreover wrote:
>>>
>>> I need to see get_ingredients() . To guess what's happening?
>>>
>>> On Tue, 3 Apr 2018, 21:22 mansi thakkar, <[email protected]> wrote:
>>>
>>>> Hello ,
>>>>
>>>> In my database, there is one table named Product and the other table is
>>>> Ingredient. Both are related with ManyToMany Relationship using bridge
>>>> entity (table) named ProductIngredient.
>>>>
>>>> I am trying to display Many To Many field named ingredient in my Django
>>>> admin site.
>>>>
>>>> Here is the attached code and screen shot of the error.
>>>>
>>>> I would like to know the solution of this error and also any other way
>>>> to display  the list of ingredients for each product.
>>>>
>>>> Thank you.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>>> gid/django-users/63c89597-39c0-4765-ab43-4df41e729f4b%40goog
>>>> legroups.com
>>>> <https://groups.google.com/d/msgid/django-users/63c89597-39c0-4765-ab43-4df41e729f4b%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/2de0db4a-e455-464b-8a46-dae694ed52e4%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/2de0db4a-e455-464b-8a46-dae694ed52e4%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CABFB2NVuBTs_GiJyVFOwC4VbpwyvmCBpGZBYJ0kDHn
> aqwPp_OQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CABFB2NVuBTs_GiJyVFOwC4VbpwyvmCBpGZBYJ0kDHnaqwPp_OQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
att.
Carlos Rocha

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO1prTG37fPSDeYpvH0TVNtg41dm-Y20e%3DvNSQZU4jd8RQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to