0

Below is my code a.py

class Order(models.Model):
 STATUS_STARTED = 0
 STATUS_SLOW =1
 STATUS_FAST=2
 STATUS_JUMP=3
 STATUS_CHOICES = (
  (STATUS_STARTED, 'STARTED'),
  (STATUS_SLOW,'SLOW')
  (STATUS_FAST,'FAST')
  (STATUS_JUMP,'JUMP')
   )
product = 
models.CharField(max_length=200)
status = 

FSMIntegerField(choices=
STATUS_CHOICES, 
default=STATUS_STARTED, 
protected=True)

A person STARTED from a point & he is either FAST or SLOW.

 @transition(field=status, source=. 
 [STATUS_STARTED],  
 target=STATUS_FAST)
 def fast(self):
     print("person run fast")

 @transition(field=status, source=. 
 [STATUS_STARTED],  
  target=STATUS_SLOW)
  def slow(self):
       print("person run slow ")

Here in above code, I can track for angle person entry only either SLOW or FAST.

Any possibility to define entries for two person at a time & one at SLOW & another at FAST state. Like maintain separate track for each person.

Parallel entries is possible in python django? Pls any help.

1 Answers1

0

By calling fast() & slow() in parallel from another call/file, it solved my need. Since bothe state share the common source point, it get solved easily. Don't know how I have missed this very very basic elements.