Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[per-object-permissions] Fixes #2652, modified the form field to incl…

…ude the app label in the select field (the elements of which are now separated by a /)

git-svn-id: http://code.djangoproject.com/svn/django/branches/per-object-permissions@3716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit aef05822d03fe0fb32be44d6bae27ee1e329d52a 1 parent ea2a514
authored September 04, 2006
8  django/contrib/admin/row_level_perm_manipulator.py
@@ -143,15 +143,15 @@ def render(self, data):
143 143
         return '\n'.join(output)        
144 144
         
145 145
     def returnObject(data):
146  
-        data = data.split('-')
147  
-        ct = ContentType.objects.get(model__exact=data[0])
148  
-        obj = ct.get_object_for_this_type(pk=data[1])
  146
+        data = data.split('/')
  147
+        ct = ContentType.objects.get(app_label__exact=data[0], model__exact=data[1])
  148
+        obj = ct.get_object_for_this_type(pk=data[2])
149 149
         return obj
150 150
 
151 151
     def returnKey(obj, ct=None):
152 152
         if not ct:
153 153
             ct = ContentType.objects.get_for_model(obj.__class__)
154  
-        return ct.model+"-"+str(obj.id)
  154
+        return ct.app_label+"/"+ct.model+"/"+str(obj.id)
155 155
     
156 156
     returnObject = staticmethod(returnObject)
157 157
     returnKey = staticmethod(returnKey)

0 notes on commit aef0582

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