Source

django-extauth / extperms / auth / management / commands / updateroles.py

Full commit
'''
Copyright 2009 H. Lee Moffitt Cancer Center and Research Institute, Inc. 
All rights reserved.

Created on Mar 9, 2010

@author: Michael Hall <mhall119@gmail.com>
'''
from django.core.management.base import NoArgsCommand
from extperms.auth.management import create_roles
from django.db.models import get_apps

class Command(NoArgsCommand):
    
    def handle_noargs(self, **options):
        verbosity = int(options.pop('verbosity', 1))
        
        for app in get_apps():
            if verbosity >= 1:
                print "Creating Roles for %s" % app.__name__
            create_roles(app, [], verbosity, **options)