معرفی شرکت ها


django-sts-0.7.3


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

State Transition System for Django
ویژگی مقدار
سیستم عامل -
نام فایل django-sts-0.7.3
نام django-sts
نسخه کتابخانه 0.7.3
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Byron Ruth
ایمیل نویسنده b@devel.io
آدرس صفحه اصلی https://github.com/cbmi/django-sts/
آدرس اینترنتی https://pypi.org/project/django-sts/
مجوز BSD
# State Transition System (STS) for Django [State Transition Systems][1] have less constraints than Finite State Automata, and can be utilized for various use cases. The core components include: - State - Event - Transition - System **Events** cause a **transition** from some **state** to a new state within a given **system**. The API supports defining _immediate_ transitions and _long-running_ transitions. Now, for a riveting example.. ```python system = System(name='Example 1') system.save() # Immediate transition.. event => state system.transition('Door Opened', event='Open Door') # 'Long-running' transitions.. event happens system.start_transition('Close Door Slowly') # Time passes.. time.sleep(2) # The resulting state.. system.end_transition('Door Closed') ``` To remove the boilerplate from the above example, use the `transition` context manager instead: ```python from sts.contextmanagers import transition with transition('Example 1', 'Door Closed', event='Close Door Slowly'): time.sleep(2) ``` A model object can be associated directly with a `System` using Django's ContentTypes framework generic foreign keys. ```python door = Door.objects.get(name='Door #1') system = System(content_object=door) # ... ``` `System` objects have a few extra conveniences: ```python # number of transitions len(system) == system.length # iteration starting with the first transition for trans in system: ... # indexing and slices system[:3] # first 3 transitions system[-3:] # last 3 transitions system[:-3] # all except the last 3 transitions system[1:3] # arbitrary slice system[2] # specific transition ``` This enables bringing in django-sts to an existing model to begin tracking states of objects. It even comes with an abstract `STSModel` that augments a model with the above methods for seamless integration (it does not add any model fields): ```python class Door(STSModel): name = models.CharField(max_length=20) door = Door() door.save() door.transition('Door Closed', event='Close Door') ``` The library leaves it up to the application to implement the constraints of a finite state automata/machine. [1]: http://en.wikipedia.org/wiki/State_transition_system


نحوه نصب


نصب پکیج whl django-sts-0.7.3:

    pip install django-sts-0.7.3.whl


نصب پکیج tar.gz django-sts-0.7.3:

    pip install django-sts-0.7.3.tar.gz