"""Load the inital data""" db.load_data(app.settings.FIXTURES_DIR) db.load_media(app.settings.FIXTURES_DIR) @manager.command def dump_data(): """Serialize the current data to fixtures/xxx.json""" db.dump_data(app.settings.FIXTURES_DIR) @manager.command def set_env(env): """Set the current environment. """ print 'SHAKE_ENV is now %s' % shake.set_env(env) @manager.command def get_env(): """Print the current environment. """ print 'SHAKE_ENV is %s' % shake.get_env() ## Insert here the imports to the manage scripts of your bundles import bundles.users.manage if __name__ == "__main__": manager.run()
def main(): manager.run() print '\n'
auth.create_user(login, passw, **data) @manager.command def change_password(login, passw): """[-login] LOGIN [-passw] NEW_PASSWORD Changes the password of an existing user.""" from app.app import auth auth.change_password(login, passw) @manager.command def add_perms(login, *perms): """[-login] LOGIN [-perms] *PERMISSIONS Add permissions to the user """ from app.models import db from app.users.models import User user = User.query.filter_by(login=login).first() if not user: raise ValueError(login) user.add_perms(perms) db.session.commit() if __name__ == "__main__": manager.run(default='runserver')
db.load_media(app.settings.FIXTURES_DIR) @manager.command def dump_data(): """Serialize the current data to fixtures/xxx.json""" db.dump_data(app.settings.FIXTURES_DIR) @manager.command def set_env(env): """Set the current environment. """ print 'SHAKE_ENV is now %s' % shake.set_env(env) @manager.command def get_env(): """Print the current environment. """ print 'SHAKE_ENV is %s' % shake.get_env() ## Insert here the imports to the manage scripts of your bundles import bundles.users.manage if __name__ == "__main__": manager.run()