Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2339: catwalk_to_rum.diff

File catwalk_to_rum.diff, 1.5 KB (added by lszyba1, 3 years ago)

Patch to replace catwalk with rum

  • devtools/templates/turbogears/+package+/controllers/root.py_tmpl

    diff -r 21f4430f61ad devtools/templates/turbogears/+package+/controllers/root.py_tmpl
    a b  
    1414{{if auth == "sqlalchemy"}} 
    1515from {{package}} import model 
    1616from {{package}}.controllers.secure import SecureController 
     17from tgrum import RumAlchemyController 
     18from tg import config 
     19 
     20# Create a prediacte to protect the RumAlchemy admin 
     21is_manager = predicates.has_permission( 
     22    'manage', 
     23    msg=_('Only for people with the "manage" permission') 
     24    ) 
    1725{{endif}} 
    1826 
    1927__all__ = ['RootController'] 
     
    3644{{if auth == "sqlalchemy"}} 
    3745    secc = SecureController() 
    3846     
    39     admin = Catwalk(model, DBSession) 
     47    #admin = Catwalk(model, DBSession) 
     48    admin = RumAlchemyController(model, 
     49        is_manager, 
     50        template_path=config['paths']['templates'][0], 
     51        render_flash=False, 
     52        ) 
     53 
    4054{{endif}} 
    4155     
    4256    error = ErrorController() 
  • devtools/templates/turbogears/setup.py_tmpl

    diff -r 21f4430f61ad devtools/templates/turbogears/setup.py_tmpl
    a b  
    1515    #url='', 
    1616    install_requires=[ 
    1717        "TurboGears2 >= 2.0b7", 
    18         "Catwalk >= 2.0.2", 
     18        "tgrum", 
    1919        "Babel >=0.9.4", 
    2020        {{if sqlalchemy}} 
    2121        "zope.sqlalchemy >= 0.4 ",