Make full_doc_path a property again.

rtd2
Eric Holscher 2010-08-14 07:09:20 -05:00
parent d9030b8629
commit 0d6e5f7b21
2 changed files with 4 additions and 2 deletions

View File

@ -24,4 +24,4 @@ def serve_docs(request, username, project_slug, filename):
if not filename:
filename = "index.html"
filename = filename.rstrip('/')
return serve(request, filename, proj.full_doc_path())
return serve(request, filename, proj.full_doc_path)

View File

@ -39,6 +39,8 @@ class Project(models.Model):
def path(self):
return os.path.join(settings.DOCROOT, self.user.username, self.slug)
#@property
#@memoize({}, 1)
def full_doc_path(self):
doc_base = os.path.join(self.path, self.slug)
for possible_path in ['docs', 'doc']:
@ -46,7 +48,7 @@ class Project(models.Model):
if os.path.exists(os.path.join(doc_base, '%s/%s/html' % (possible_path, pos_build))):
return os.path.join(doc_base, '%s/%s/html' % (possible_path, pos_build))
full_doc_path = memoize(full_doc_path, {}, 1)
full_doc_path = property(memoize(full_doc_path, {}, 1))
def save(self, *args, **kwargs):