From d0c3331f9f1d07e7b980af82f3c026d3347e8dd2 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 20 Sep 2016 21:05:14 +0000 Subject: [PATCH] Clarified the differences between Document.href() and Document.get_absolute_url(). Updated PLAN. - Legacy-Id: 12012 --- PLAN | 7 ------- ietf/doc/models.py | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/PLAN b/PLAN index 66686d18f..c7f72eb1d 100644 --- a/PLAN +++ b/PLAN @@ -7,8 +7,6 @@ Updated: $Date$ Planned work in rough order =========================== -* Merge in manual post work from Spherical Cow - * Glue code for WG issue trackers and wiki: - create new trackers on group creation - update access lists on group chair/secretary changes @@ -33,11 +31,6 @@ Planned work in rough order * Revisit floorplans: Add room coordinate input tool (javascript). Add NOC object annotation possibilities. -* Refactor to one function instead of having both Document.get_absolute_url() - and Document.href(), which should do the same thing, but don't today. Also - change the default draft href to be the datatracker url now that we support - revisions. - * Add support for internationalised email addresses according to RFC 6531 when sending email (this is not supported by smtplib under Python 2.7, so will need support code in the application until we migrate to Python 3.5) diff --git a/ietf/doc/models.py b/ietf/doc/models.py index 9e7012a8a..898b89134 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -93,6 +93,10 @@ class DocumentInfo(models.Model): return settings.DOCUMENT_PATH_PATTERN.format(doc=self) def href(self): + """ + Returns an url to the document text. This differs from .get_absolute_url(), + which returns an url to the datatracker page for the document. + """ # If self.external_url truly is an url, use it. This is a change from # the earlier resulution order, but there's at the moment one single # instance which matches this (with correct results), so we won't @@ -379,6 +383,10 @@ class Document(DocumentInfo): return self.name def get_absolute_url(self): + """ + Returns an url to the document view. This differs from .href(), + which returns an url to the document content. + """ name = self.name if self.type_id == "draft" and self.get_state_slug() == "rfc": name = self.canonical_name()