[Patchew-devel] [PATCH 2/3] rest: POST for message endpoint

Shubham Jain shubhamjain7495 at gmail.com
Tue May 8 14:20:42 UTC 2018


Alright. Will keep this in mind from next time. :)

On Tue, May 8, 2018 at 6:50 PM Paolo Bonzini <pbonzini at redhat.com> wrote:

> On 08/05/2018 13:50, Shubham Jain wrote:
> > - Add "create" method to MessageManager so that it calls save_mbox()
> > - Fix nested writable serializer issue
> > - Add test for the create
>
> A better commit message could be
>
> "Creation of a message is handled by the new "create" method in
> MessageManager, which also takes care of calling save_mbox().  The code
> currently has some code duplication with add_message_from_mbox(), which
> will be fixed soon.  The "create" name follows Django idioms more
> closely and is what DRF expects.
>
> However, due to the nested AddressSerializer, the CreateModelMixin is
> not enough, we have to define a "create" method in BaseMessageSerializer
> too."
>
> The idea is to describe what you are actually doing and also say why
> you're doing.
>
> Paolo
>
> > ---
> >  api/models.py      |  19 +++++++
> >  api/rest.py        |  20 ++++---
> >  tests/test_rest.py | 153
> +++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 185 insertions(+), 7 deletions(-)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/patchew-devel/attachments/20180508/2cdf1bf8/attachment.htm>


More information about the Patchew-devel mailing list