在将一些项目添加到我的“国家”ManyToManyField后,我无法返回对象。 我可以看到我的数据已保存
class CompanyProfileManager(models.Manager):
@transaction.atomic
def register_company(self, name, description, tag_name, email, is_private, uses_credits, pays_subscription, pool,
facebook, twitter, web, country, videocall_doctor_to_patient, micro_type, can_move, fixed_percentage, fixed_price, fixed_tariff, instagram, subdomain, banner_description, banner_title, countries, **kwargs):
tag = Tag(name=tag_name, description=tag_name, is_active=True)
tag.save()
company = self.create_instance(name, description, email, is_private, uses_credits, pays_subscription, pool,
facebook, twitter, web, country, videocall_doctor_to_patient, micro_type, can_move, fixed_percentage, fixed_price, fixed_tariff, instagram, subdomain, banner_description, banner_title)
company.tag = tag
company.save()
for item in countries:
company.countries.add(item)
return company #Using Debug Mode, My project breaks right here
我真的很迷茫,到目前为止,我所看到与我的问题相关的唯一内容是使用.all()作为查询集