Pyramid_formalchemy 关于请求的假设
我正在使用 Pyramid_formalchemy 0.4.1...我正在尝试使用它。
当请求进入我的应用程序时,我不断看到 Pyramid_formalchemy 对请求对象中的内容做出奇怪的假设。我的请求失败,因为在pyramid_formalchemy.views(从第58行开始)中,ModelView类有一个带有以下代码的构造函数:
def __init__(self, context, request):
self.context = context
self.request = request
self.session = request.session_factory
self.fieldset_class = request.forms.FieldSet
self.grid_class = request.forms.Grid
问题是我的请求对象有一个“session”而不是“session_factory”。它也没有“表单”
这是我所做的:
- 创建一个扩展pyramid_formalchemy.resources.Models的RootFactory
- 我调用config.formalchemy_admin()将其传递给我的RootFactory和我的DBSession
- 我创建了一个空的forms.py文件。
我的设置中缺少什么?有什么想法吗?
谢谢。
I'm using pyramid_formalchemy 0.4.1...well I'm trying to use it.
When requests come in to my app I keep seeing pyramid_formalchemy making strange assumptions about what will be in the request object. My requests fail because in pyramid_formalchemy.views (starting at line: 58) the ModelView class has a constructor with the following code:
def __init__(self, context, request):
self.context = context
self.request = request
self.session = request.session_factory
self.fieldset_class = request.forms.FieldSet
self.grid_class = request.forms.Grid
The thing is my request object has a 'session' not a 'session_factory'. It also doesn't have 'forms'
Here is what I've done:
- Create a RootFactory that extends pyramid_formalchemy.resources.Models
- I call config.formalchemy_admin() passing it my RootFactory and my DBSession
- I created an empty forms.py file.
What am I missing in my setup? Any ideas?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个东西是可以配置的。
请参阅来源
不确定它是否真的记录在案..
This stuff is configurable.
See the source
Not sure it's really documented..