graphene-django-cud
graphene-django-cud copied to clipboard
Add before_create_obj hook to BatchCreateMutation
Advances #126
@tOgg1 I would be glad to get some feedback.
@tOgg1 Sorry to ping you again, but it would help us if we could use this feature.
@tOgg1 Sorry to ping you again, but it would help us if we could use this feature.
Sorry to bother you again, but is there any chance to get this usable? @tOgg1
Hi @hansegucker.
Thank you for being patient. I will do a new round of updates and improvements on this library in the coming week. I'll make sure to fast-track this PR and the underlying issues.
Hi @hansegucker.
I've pulled your branch and done some initial testing. There is a single issue with the test test__one_to_one_relation_exists__creates_specified_fields which fails. It fails because the object is not saved until after the block adding one_to_one relations has run.
Moving the call to before_create_obj and adding another save there, seems to fix the issue:
obj = Model(**model_field_values)
cls.before_create_obj(info, input, obj)
obj.save()
# Handle one to one rels
if len(one_to_one_rels) > 0:
...
Please have a look at this. Could you also move the before_create_obj stub to the bottom of the DjangoCudBase class, alongside the other stubs?
When this is fixed the PR should be ready to be merged.
Hey, thank you! I fixed the mentioned things and look forward to get this merged.
Hi.
The save is still in the wrong place. It needs to be above the line if len(one_to_one_rels) > 0:.
Hi.
The save is still in the wrong place. It needs to be above the line
if len(one_to_one_rels) > 0:.
Oh, sorry, I missed that. I hope that now everything is fine.
@tOgg1 Can we get a release with this change? That would be super helpful.
@hansegucker v0.12.0 out today.