Nesting tastypie UserProfileResource and UserResource, null value in column \“user_id\” violates not-null constraint
问题 This is my setup: class UserProfile(models.Model): user = models.OneToOneField(User, unique=True, related_name="profile") class UserProfileResource(ModelResource): class Meta: queryset = UserProfile.objects.all() resource_name = 'profile' authorization = Authorization() class UserResource(ModelResource): profile = fields.ToOneField(UserProfileResource, attribute='userprofile', related_name='user', full=True, null=True) class Meta: queryset = User.objects.all() resource_name = 'user'