From 79e37f85c3f74989f6e5e6faf9e14523667b2acc Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 1 Jul 2015 13:31:22 +0200 Subject: [PATCH] Better docstrings. --- partner_firstname/models.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/partner_firstname/models.py b/partner_firstname/models.py index c529fbfc6..86037a3eb 100644 --- a/partner_firstname/models.py +++ b/partner_firstname/models.py @@ -47,7 +47,13 @@ class ResPartner(models.Model): @api.one def _inverse_name_after_cleaning_whitespace(self): - """Clean whitespace in ``name`` and call :meth:`._inverse_name`.""" + """Clean whitespace in :attr:`~.name` and split it. + + Removes leading, trailing and duplicated whitespace. + + The splitting logic is stored separately in :meth:`~._inverse_name`, so + submodules can extend that method and get whitespace cleaning for free. + """ # Remove unneeded whitespace clean = u" ".join(self.name.split(None)) @@ -68,7 +74,7 @@ class ResPartner(models.Model): This method can be easily overriden by other submodules. - When this method is called, ``self.name`` already has unified and + When this method is called, :attr:`~.name` already has unified and trimmed whitespace. """ # Company name goes to the lastname