Re: Display Many to Many Field in Django admin site

2018-04-03 Thread carlos
[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 wrote: > kindly share

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread Muhammad bin-haneef
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 wrote: > It is there in ProductIngr

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread mansi thakkar
Yes I have. But it didn't work. Basically my product has many ingredients and on ingredient is contained in many products so all I need is just display product with all the ingredients it contains on admin site. On Tuesday, April 3, 2018 at 12:48:34 PM UTC-4, Julio Biason wrote: > > It seems you

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread Julio Biason
It seems your `get_ingredients()` is expecting the Product itself and another object (for some reason). Have you tried to remove `obj` from the parameters and use `self` in that function? On Tue, Apr 3, 2018 at 12:22 PM, mansi thakkar wrote: > Hello , > > In my database, there is one table name

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread mansi thakkar
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, > wrote: > >> Hello , >> >> In my database, there is one table named Product an

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread squal poreover
I need to see get_ingredients() . To guess what's happening? On Tue, 3 Apr 2018, 21:22 mansi thakkar, 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 Produ