单个model
obj = Category.objects.get(id=1)
obj_dict = model_to_dict(obj)
结果集QuerySet
category = Category.objects.filter(parent_id=0)
list_dict = category.values()
单个model
obj = Category.objects.get(id=1)
obj_dict = model_to_dict(obj)
结果集QuerySet
category = Category.objects.filter(parent_id=0)
list_dict = category.values()