sprox

The hello world of sprox with pyramid

对着背影说爱祢 提交于 2019-12-25 02:24:50
问题 I've tried to build the simplest possible form in Sprox using pyramid. # model.py class Allocation: # some fields ... class SproxForm(AddRecordForm): __model__ = Allocation sprox_form = SproxForm(DBSession) # views.py def sprox_form(request): return {'f':sprox_form,'kw':{}} <html> <body> <div tal:content="structure f(kw)"/> </body> </html> But it just prints out {'kw': {}, 'f': } The forms tutorial is written using TurboGears2 and I am unable to translate it to pyramid, because I am new to

Hello world of sprox with pyramid - part 2

好久不见. 提交于 2019-12-11 06:51:25
问题 I've tried to build the simplest possible form in Sprox using pyramid. # model.py class Allocation: # some fields ... class SproxForm(AddRecordForm): __model__ = Allocation sprox_form = SproxForm(DBSession) # views.py @view_config(route_name='sprox_add', renderer='templates/sprox.pt') def sprox_form_add(request): return {'form':sprox_form,'form_input':{}} <!-- sprox.pt --> <html> <body> <div tal:content="structure form(form_input)"/> </body> </html> When I navigate to that view in the browser

Sprox form with Turbogears, using Mako, only displays plain text

余生长醉 提交于 2019-12-11 03:44:48
问题 I'm generating a Sprox form with Turbogears 2.1 and trying to display it in a Mako template. Here is my code: To define the form: class NewUserForm(AddRecordForm): __model__ = User newuserform = NewUserForm(DBSession) The controller definition that assigns the form and calls the template: @expose('limelight.modules.users.templates.register') def register(self, **kw): tmpl_context.register_form = newuserform return dict(value=kw) And the relevant template code: ${tmpl_context.register_form