Commits

d3f3nd3r  committed 0a47fec

rename _fk_list to fk_list

  • Participants
  • Parent commits fb23e01

Comments (0)

Files changed (3)

File djangotoolbox/auth/backends.py

             perm_objs = set([])
             try:
                 gl = GroupList.objects.get(user=user_obj)
-                group_ids = gl._fk_list
+                group_ids = gl.fk_list
                 if len(group_ids) > 0:
                     group_permissions = set()
                     for group_id in group_ids:

File djangotoolbox/auth/models.py

 
 class UserPermissionList(models.Model):
     user = models.ForeignKey(User)
-    _fk_list = ListField(models.ForeignKey(Permission))
+    fk_list = ListField(models.ForeignKey(Permission))
 
     def _get_permissions(self):
         if not hasattr(self, '_permissions_cache'):
-            setattr(self, '_permissions_cache', get_objs(Permission, self._fk_list))            
+            setattr(self, '_permissions_cache', get_objs(Permission, self.fk_list))            
         return self._permissions_cache
     permissions = property(_get_permissions)
 
 
 class GroupPermissionList(models.Model):
     group = models.ForeignKey(Group)
-    _fk_list = ListField(models.ForeignKey(Permission))
+    fk_list = ListField(models.ForeignKey(Permission))
 
     def _get_permissions(self):
         if not hasattr(self, '_permissions_cache'):
-            setattr(self, '_permissions_cache', get_objs(Permission, self._fk_list))            
+            setattr(self, '_permissions_cache', get_objs(Permission, self.fk_list))            
         return self._permissions_cache
     permissions = property(_get_permissions)
 
     GroupLists are used to map a list of groups to a user
     """
     user = models.ForeignKey(User)
-    _fk_list = ListField(models.ForeignKey(Group))
+    fk_list = ListField(models.ForeignKey(Group))
 
     def __unicode__(self):
         return u'%s' %(self.user.username)
     
     def _get_group_list(self):
         if not hasattr(self, '_groups_cache'):
-            setattr(self, '_groups_cache', get_objs(Group, self._fk_list))
+            setattr(self, '_groups_cache', get_objs(Group, self.fk_list))
         return self._groups_cache
     groups = property(_get_group_list)

File djangotoolbox/auth/utils.py

 def add_to(obj, list_cls, filter):
     obj_list, created = list_cls.objects.get_or_create(**filter)
 
-    obj_list._fk_list.append(obj.id)
+    obj_list.fk_list.append(obj.id)
     obj_list.save()
 
 def add_permission_to_user(perm, user):