Permalink
Browse files

Fix docs links. Fix #34

  • Loading branch information...
1 parent 3d3c045 commit 6107d41d90bab9365a39a61a717efdae6d383f10 @meshy meshy committed May 24, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 inspector/cbv/models.py
View
@@ -35,6 +35,10 @@ def get_absolute_url(self):
'version': self.version_number,
})
+ @property
+ def docs_version_number(self):
+ return '.'.join(self.version_number.split('.')[:2])
+
class Module(models.Model):
""" Represents a module of a python project """
@@ -85,8 +89,9 @@ def get_absolute_url(self):
})
def get_djangodocs_url(self):
- url = 'https://docs.djangoproject.com/en/dev/ref/class-based-views/'
- return url + '#{module}.{klass}'.format(
+ url = 'https://docs.djangoproject.com/en/{version}/ref/class-based-views/#{module}.{klass}'
+ return url.format(
+ version=self.module.project_version.docs_version_number,
module=self.module.name,
klass=self.name,
)

0 comments on commit 6107d41

Please sign in to comment.