我有 2 个相互具有外键的资源,例如:
class GroupResource(ModelResource):
categories = fields.ToManyField(CategoryResource, 'category_set', 'categories', full=True)
class Meta:
queryset = Group.objects.all()
class CategoryResource(ModelResource):
subcategories = fields.ToManyField(SubcategoryResource, 'subcategory_set', 'subcategories', full=True)
class Meta:
queryset = Category.objects.all()
当我列出它时,GroupResource
它也会列出subcategories
. 我怎样才能防止这种情况,只列出categories
而不是subcategories
?