Commits

Kai Diefenbach committed b09e47c

Cleaned up doc strings

  • Participants
  • Parent commits b525ce9

Comments (0)

Files changed (2)

workflows/tests.py

         result = workflows.utils.get_workflow_for_model(ctype)
         self.assertEqual(result, None)
 
-        result = workflows.utils.get_workflow_for_obj(self.user)
+        result = workflows.utils.get_workflow_for_object(self.user)
         self.assertEqual(result, None)
 
     def test_remove_workflow_from_object(self):
         result = workflows.utils.get_workflow_for_model(ctype)
         self.assertEqual(result, None)
 
-        result = workflows.utils.get_workflow_for_obj(self.user)
+        result = workflows.utils.get_workflow_for_object(self.user)
         self.assertEqual(result, None)
 
     def test_remove_workflow_2(self):

workflows/utils.py

 
     workflow
         The workflow which should be set to the object or model.
+
     ctype_or_obj
         The content type or the object to which the passed workflow should be
         set. Can be either a ContentType instance or any Django model
     workflow
         The workflow which should be set to the object. Can be a Workflow
         instance or a string with the workflow name.
+
     obj
         The object which gets the passed workflow.
     """
             workflow = Workflow.objects.get(name=workflow)
         except Workflow.DoesNotExist:
             return False
-    
+
     workflow.set_to_object(obj)
 
 def set_workflow_for_model(ctype, workflow):
     workflow
         The workflow which should be set to passend content type. Must be a
         Workflow instance.
+
     ctype
         The content type to which the passed workflow should be assigned. Can
         be any Django model instance
         The object for which the workflow should be returend. Can be any
         Django model instance.
     """
-    workflow = get_workflow_for_obj(obj)
+    workflow = get_workflow_for_object(obj)
     if workflow is not None:
         return workflow
 
     ctype = ContentType.objects.get_for_model(obj)
     return get_workflow_for_model(ctype)
 
-def get_workflow_for_obj(obj):
+def get_workflow_for_object(obj):
     """Returns the workflow for the passed object.
 
     **Parameters:**
         return False
 
 def set_state(obj, state):
-    """Sets the current state for the passed object and updates the
-    permissions for the object.
+    """Sets the state for the passed object to the passed state and updates 
+    the permissions for the object.
 
     **Parameters:**
 
     obj
         The object for which the workflow state should be set. Can be any
         Django model instance.
+
     state
         The state which should be set to the passed object.
     """
 
     obj
         The object for which the transitions should be returned.
+
     user
         The user for which the transitions are allowed.
     """
     return transitions
 
 def update_permissions(obj):
-    """Updates the permission of the object according to the object's current
-       workflow state.
+    """Updates the permissions of the passed object according to the object's 
+    current workflow state.
     """
     workflow = get_workflow(obj)
     state = get_state(obj)