<commit_before>
# django-fsm-admin

Mixin and template tags to integrate django-fsm state transitions into 
the django admin.

## Usage

In your admin.py file:

    from fsm_admin.mixins import FSMTransitionMixin

    class YourModelAdmin(FSMTransitionMixin, admin.ModelAdmin):
        pass

    admin.site.register(PublishableModel, PublishableModelAdmin)

Override the admin change_form.html for your model
(your_app/templates/admin/your_app/your_model/change_form.html)

    {% extends 'admin/change_form.html' %}
    {% load fsm_admin %} 

    {% block submit_buttons_bottom %}{% fsm_submit_row %}{% endblock %}

    {% block after_field_sets %}
        {{ block.super }}
        {% block transition_hints %}{% fsm_transition_hints %}{% endblock %}
    {% endblock %}  

## Try the example

    mkvirtualenv fsm_admin
    python setup.py develop
    cd example
    pip install -r requirements.txt
    ./manage.py syncdb
    ./manage.py runserver<commit_msg>Improve trying the example instructions<commit_after>
# django-fsm-admin

Mixin and template tags to integrate django-fsm state transitions into 
the django admin.

## Usage

In your admin.py file:

    from fsm_admin.mixins import FSMTransitionMixin

    class YourModelAdmin(FSMTransitionMixin, admin.ModelAdmin):
        pass

    admin.site.register(PublishableModel, PublishableModelAdmin)

Override the admin change_form.html for your model
(your_app/templates/admin/your_app/your_model/change_form.html)

    {% extends 'admin/change_form.html' %}
    {% load fsm_admin %} 

    {% block submit_buttons_bottom %}{% fsm_submit_row %}{% endblock %}

    {% block after_field_sets %}
        {{ block.super }}
        {% block transition_hints %}{% fsm_transition_hints %}{% endblock %}
    {% endblock %}  

## Try the example

    git clone <EMAIL>:gadventures/django-fsm-admin.git
    cd django-fsm-admin
    mkvirtualenv fsm_admin
    pip install -r requirements.txt
    python fsm_admin/setup.py develop
    cd example
    ./manage.py syncdb
    ./manage.py runserver
{'fraction_non_alphanumeric': 0.09523809523809523, 'fraction_numerical': 0.0, 'mean_word_length': 3.4595185995623634, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3239831', 'n_tokens_mistral': 666, 'n_tokens_neox': 622, 'n_words': 152}