Zope: cannot access REQUEST under property decorator

后端 未结 2 1795
失恋的感觉
失恋的感觉 2021-01-05 14:34

I\'m trying to use the property decorator in a Class. While it works well per se, I can\'t use any code that has to access the REQUEST.

class So         


        
2条回答
  •  自闭症患者
    2021-01-05 15:26

    If you want to route around needing acquisition and cannot explicitly set the request from calling code in the constructor of your class, use zope.globalrequest. Otherwise, you may want to consider a browser view (which always multi-adapts some context and a request).

提交回复
热议问题