def get_form_kwargs(self):
        kwargs = super(NgCRUDView, self).get_form_kwargs()
        # Since angular sends data in JSON rather than as POST parameters, the default data (request.POST)
        # is replaced with request.body that contains JSON encoded data
        kwargs['data'] = json.loads(self.request.body.decode('utf-8'))

        # Add instance if object identifier present
        if 'pk' in self.request.GET or self.slug_field in self.request.GET:
            kwargs['instance'] = self.get_object()
        return kwargs
dataset/ETHPy150Open jrief/django-angular/djng/views/crud.py/NgCRUDView.get_form_kwargs/original