1👍
Have a look at the filter documentation.
To get a group of subcategories whose category field is populated by the category my_cat
, you would do –
sub_cats = SubCategory.objects.filter(category=my_cat)
Source:stackexchange.com
1👍
Have a look at the filter documentation.
To get a group of subcategories whose category field is populated by the category my_cat
, you would do –
sub_cats = SubCategory.objects.filter(category=my_cat)