Some hints to handle categories

42 views
Skip to first unread message

Bastien Roques

unread,
Jan 6, 2017, 9:14:36 AM1/6/17
to django-oscar
Hi,

Can someone give me  some hints to manipulate categories ?

How can I get a list of first depth categories object for example? I've seen that it inherits from treebeard in which I'm absolutely not an expert !

Any help is welcome !

Bastien Roques

unread,
Jan 6, 2017, 9:51:19 AM1/6/17
to django-oscar
I found out this:

cats = Category.get_tree().order_by('name')
for cat in cats:
 
if cat.get_depth() == 1:
 res
.append(cat)
Message has been deleted

Alex House

unread,
Jan 23, 2017, 8:11:33 PM1/23/17
to django-oscar
Hello. Can you tell how you print a list of the categories of goods on the main page. Faced with this problem, and standard solutions do not work. Shows 0 items.
I will be glad example code.

суббота, 7 января 2017 г., 0:51:19 UTC+10 пользователь Bastien Roques написал:
Reply all
Reply to author
Forward
0 new messages