Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed unused variable and changed comments about `permalink` decora…

…tor into a docstring.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5719 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9a1c21809ed48b0d06c1e2395bf6a7c7b900f96a 1 parent 2679bc0
Gary Wilson Jr. authored July 16, 2007

Showing 1 changed file with 9 additions and 5 deletions. Show diff stats Hide diff stats

  1. 14  django/db/models/__init__.py
14  django/db/models/__init__.py
@@ -15,14 +15,18 @@
15 15
 # Admin stages.
16 16
 ADD, CHANGE, BOTH = 1, 2, 3
17 17
 
18  
-# Decorator. Takes a function that returns a tuple in this format:
19  
-#     (viewname, viewargs, viewkwargs)
20  
-# Returns a function that calls urlresolvers.reverse() on that data, to return
21  
-# the URL for those parameters.
22 18
 def permalink(func):
  19
+    """
  20
+    Decorator that calls urlresolvers.reverse() to return a URL using
  21
+    parameters returned by the decorated function "func".
  22
+
  23
+    "func" should be a function that returns a tuple in one of the
  24
+    following formats:
  25
+        (viewname, viewargs)
  26
+        (viewname, viewargs, viewkwargs)
  27
+    """
23 28
     from django.core.urlresolvers import reverse
24 29
     def inner(*args, **kwargs):
25 30
         bits = func(*args, **kwargs)
26  
-        viewname = bits[0]
27 31
         return reverse(bits[0], None, *bits[1:3])
28 32
     return inner

0 notes on commit 9a1c218

Please sign in to comment.
Something went wrong with that request. Please try again.