Template designers have no easy way to specify anchor pattern for Comment.get_absolute_url
|Reported by:||idangazit||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Comment.get_absolute_url() takes an anchor_pattern argument which specifies the desired form of the named anchor for a comment.
def get_absolute_url(self, anchor_pattern="#c%(id)s"): return self.get_content_object_url() + (anchor_pattern % self.__dict__)
Because there's no way to specify the desired anchor pattern when calling from a template, designers are stuck with the default anchor pattern unless a developer steps in to help.
The comments app is full of template tags which make life easy for the designer, seems like what's needed here is a get_comment_permalink template tag which takes an anchor pattern as an optional argument.
Change History (6)
comment:1 Changed 6 years ago by idangazit
- Has patch set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 6 years ago by jezdez
- milestone set to 1.2
- Needs tests set
- Triage Stage changed from Unreviewed to Accepted