<s> from django . shortcuts import render_to_response , get_object_or_404 <EOL> from django . template import RequestContext <EOL> from django . utils . translation import ugettext as _ <EOL> from transifex . txcommon . decorators import one_perm_required_or_403 <EOL> from transifex . projects . models import Project <EOL> from transifex . projects . permissions import pr_resource_priority <EOL> from transifex . resources . models import Resource <EOL> @ one_perm_required_or_403 ( pr_resource_priority , <EOL> ( Project , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> def cycle_resource_priority ( request , project_slug , resource_slug , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> resource = get_object_or_404 ( Resource , project__slug = project_slug , <EOL> slug = resource_slug ) <EOL> resource . priority . cycle ( ) <EOL> return render_to_response ( "<STR_LIT>" , <EOL> { '<STR_LIT>' : resource . priority } , <EOL> context_instance = RequestContext ( request ) ) </s>
