[PATCH 3/3] ui: Add version to series name

Stephen Finucane stephen at that.guru
Fri Nov 18 12:18:45 AEDT 2016

There's no way to distinguish between different patch versions in the
UI if those patches are using cover letter or user-based names. We
can't store the version as part of the name (in the database) at this
has the potential to change, so the version must be populated
manually. This results in some duplication for series with patch-based
names but this is an acceptable compromise.

Signed-off-by: Stephen Finucane <stephen at that.guru>
 patchwork/models.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/patchwork/models.py b/patchwork/models.py
index d1d0857..05809e2 100644
--- a/patchwork/models.py
+++ b/patchwork/models.py
@@ -686,7 +686,8 @@ class Series(models.Model):
     def __str__(self):
-        return self.name if self.name else 'Untitled series #%d' % self.id
+        return ('%s (v%d)' % (self.name, self.version) if self.name
+                else 'Untitled series #%d' % self.id)
     class Meta:
         ordering = ('date',)

More information about the Patchwork mailing list