Skip to content

Commit

Permalink
Merge pull request #25 from wermut/master
Browse files Browse the repository at this point in the history
Add compatibility for python 3.2+
  • Loading branch information
Craig Nagy committed Jan 30, 2015
2 parents 209aa51 + 4df8be1 commit c202732
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ Usage
-----
1. Add ``fsm_admin`` to your INSTALLED_APPS

2. Ensure that you have "django.core.context_processors.request" in your TEMPLATE_CONTEXT_PROCESSORS in Django settings
2. Ensure that you have "django.core.context_processors.request" in your TEMPLATE_CONTEXT_PROCESSORS in Django settings. If TEMPLATE_CONTEXT_PROCESSORS is not yet defined, add
::
from django.conf import global_settings

TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
'django.core.context_processors.request',
)


3. In your ``admin.py`` file, use `FSMTransitionMixin` to add behaviour to your ModelAdmin.

Expand Down
2 changes: 1 addition & 1 deletion fsm_admin/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _is_transition_available(self, obj, transition, request):
Checks if the requested transition is available
"""
transitions = []
for field, field_transitions in self._fsm_get_transitions(obj, request).iteritems():
for field, field_transitions in iter(self._fsm_get_transitions(obj, request).items()):
transitions += [t.name for t in field_transitions]
return transitions

Expand Down
2 changes: 1 addition & 1 deletion fsm_admin/templatetags/fsm_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def button_name(transition):

ctx = submit_row(context)
ctx['transitions'] = []
for field,field_transitions in transitions.iteritems():
for field,field_transitions in iter(transitions.items()):
ctx['transitions'] += [(field, button_name(t), t.name) for t in field_transitions]
ctx['perms'] = context['perms']

Expand Down

0 comments on commit c202732

Please sign in to comment.