Commits

Anonymous committed 2685d0a Merge

added in unicode reprs for some objects

  • Participants
  • Parent commits 850acca, b442af5

Comments (0)

Files changed (2)

File statemachine/fields.py

         defaults.update(kwargs)
         super(FSM_StateField, self).__init__(self, **defaults)
 
+    def __unicode__(self):
+        return self.name
+
+    def setup(self, state_name):
+        if not self._machine:
+            self._machine = deepcopy(self.__base_machine)
+
+        self._machine.set_initial_state(state_name)
 
     def db_type(self, connection):
         return "char(50)"

File statemachine/fsm.py

         self.entry_action = entry_action
         self.exit_action = exit_action
 
+    def __unicode__(self):
+        return self.name
+
+
     def exit(self, target_state, *args, **kwargs):
         """ 
         Checks states and exits if possible, if not possible it raises FSM_TransitionNotAllowed 
         self.dbg = None
         self.verify_on_execute = verify_on_execute
 
+    def __unicode__(self):
+        return self.__state
+
     def getstate(self):
         return self.__state