Adding new ManyToMany Field in products

20 views
Skip to first unread message

Kerwin Jorbina

unread,
Apr 25, 2018, 3:04:20 PM4/25/18
to django-oscar


The color_list.html just uses the django-tables2:


{% render_table colors %}



Samir Shah

unread,
Apr 25, 2018, 10:08:50 PM4/25/18
to django-oscar
You are passing the wrong argument to render_table. Either do:

{% render_table colors %}

Or set `context_table_name = 'colors'` on your view. You've set `context_object_name` but that is not what your custom table class is saved to, and you're ending up passing a normal queryset to the renderer, instead of your custom table class.

Kerwin Jorbina

unread,
Apr 25, 2018, 10:14:55 PM4/25/18
to django-oscar
Thank you very much! That did the trick. I was looking into this part for hours and did not notice that I wrote it as context_object_name. 

Samir Shah

unread,
Apr 25, 2018, 10:16:10 PM4/25/18
to django-oscar
Sorry, I meant "either do `render_table table`". Looks like you've got it working now!
Reply all
Reply to author
Forward
0 new messages