Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Update doc, close #41
Browse files Browse the repository at this point in the history
  • Loading branch information
kmmbvnr committed May 21, 2014
1 parent fc27dab commit a0e9351
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ def legal_hold(self):
Side effects galore
"""
```

### `state_choices`
Instead of passing two elements list `choices` you could use three elements `state_choices`,
the last element states for string reference to model proxy class.

Base class instance would be dynamically changed to corresponding Proxy class instance, depends on state.
Even for queryset results, you will get Proxy class instances, even if QuerySet executed on base class.

Check the [test case](https://github.com/kmmbvnr/django-fsm/blob/master/tests/testapp/tests/test_state_transitions.py)
for example usage. Or read about [implementation internals](http://schinckel.net/2013/06/13/django-proxy-model-state-machine/)

### Permissions
It is common to have permissions attached to each model transition. `django-fsm` handles this with
`permission` keyword on the `transition` decorator. `permission` accepts a permission string, or
Expand Down Expand Up @@ -275,6 +286,9 @@ Changelog

<img src="https://f.cloud.github.com/assets/41479/2227946/a9e77760-9ad0-11e3-804f-301d075470fe.png" alt="django-fsm" width="100px"/>

### django-fsm GIT
* Support for [class substitution](http://schinckel.net/2013/06/13/django-proxy-model-state-machine/) to proxy classes depends on state

### django-fsm 2.1.0 2014-05-15
* Support for attaching permission checks on model transitions

Expand Down

0 comments on commit a0e9351

Please sign in to comment.