Commits

Michael Hall committed 70f8574

Add _name and _manager to roles

Comments (0)

Files changed (1)

         for aName, a in attrs.items():
             if isinstance(a, RoleBase):
                 roles[aName] = a
+                a._name = aName
             else:
                 setattr(new_class, aName, a)
         setattr(new_class, '_roles', roles)
             role = copy.deepcopy(r)
             role.user = self.user
             role.model = self.model
+            role._manager = self
             roles[rName] = role
         setattr(self, 'roles', roles)