请教个repoze.bfg的问题

3 views
Skip to first unread message

leopay

unread,
Jul 19, 2009, 10:42:32 PM7/19/09
to CZUG-Plone技术讨论
http://static.repoze.org/bfgdocs/narr/urldispatch.html#example-4
这个代码好像有问题
class Article(object):
def __init__(self, environ):
self.__dict__.update(environ['repoze.bfg.matchdict'])

def is_root(self):
return self['article'] == 'root'

我print environ看到,environ里没有repoze.bfg.matchdict,只有bfg.routes.matchdict
self['article']中个好像也不对,应该是self.article
Reply all
Reply to author
Forward
0 new messages