Thank you for this amazing package, I'm following same apprach to perform other crud operatations. and It is working fine. But I've one questions, how can i implement nested field muation and also how can i upload images. I mean simple model form works or not?
for example, I've moodel called Media, and Here is mutations for model.
class CreateMedia(
RelayMutationMixin,
DynamicInputMixin,
Output,
graphene.ClientIDMutation):
form = MediaForm
_inputs = list(form.Meta.fields)
media = graphene.Field(MediaNode)
@classmethod
@login_required
def resolve_mutation(cls, root, info, **kwargs):
f = cls.form(kwargs)
if f.is_valid():
try:
media = f.save()
return cls(success=True, media=media)
except Exception as e:
return cls(success=False, errors="Some things went wrongs")
else:
return cls(success=False, errors=f.errors.get_json_data())
and here is model
class MediaForm(forms.ModelForm):
class Meta:
model = Media
fields = ("media", "content_type", "object_id")
Prerequisites
For more information, see the CONTRIBUTING guide.
Description
Thank you for this amazing package, I'm following same apprach to perform other crud operatations. and It is working fine. But I've one questions, how can i implement nested field muation and also how can i upload images. I mean simple model form works or not?
for example, I've moodel called Media, and Here is mutations for model.
and here is model
But it is not working