Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Arulnathan committed Jan 24, 2014
1 parent c0a2fe5 commit d4dc41b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,16 @@ article.submit(by=some_user) # StateLog.by will be some_user

### Advanced Usage
You can change the behaviour of this app by turning on caching for StateLog records.
Simply add `DJANGO_FSM_LOG_USE_CACHE = True` to your project's settings file. By
default your project's `'default'` cache backend will be used to store this data. If you wish to
use a different cache backend, add `DJANGO_FSM_LOG_CACHE_BACKEND = 'custom_backend'` to your settings file.
Simply add `DJANGO_FSM_LOG_CACHE_BACKEND = 'backend_name'` to your project's settings file. This
will store any pending StateLog records in the cache using the cache backend you specified.

When caching is on, you can access the StateLog record before the transition takes place,
and before it has been persisted to the database.
This is useful if you need to verify whether or not the StateLog has been written to the database.
Access to the pending StateLog record is available via the `pending_objects` manager

```python
from django_fsm_log.models import StateLog
article = Article.objects.get(...)
pending_state_log = StateLog.objects.get_pending_for_object(article)
pending_state_log = StateLog.pending_objects.get_for_object(article)
```

This pending StateLog object is available after the `django_fsm.signals.pre_transition`
Expand Down

0 comments on commit d4dc41b

Please sign in to comment.