More documentation issues

Issue #2 new
created an issue


This time I will try to get all the comments in one submission... Looking at the page you uploaded today:

The typical example page refers to self.request, I think that should just be request with def edit(request):, etc.

session wasn't imported (assuming a DBSession?):

item = session.query(MyModel).get(item_id)

Also, looks like you need to have sessions enabled for the CSRF to work, might be worth a mention?

After fixing these the demo ran (at least add, it's bedtime and I haven't figured out edit yet), though:

if form.validate(): never seemed to be true?



PS Is there a reason the only "Type" option is "bug" on the submit form for Bitbucket?

Comments (4)

  1. Dan Jacob repo owner

    In order to get a full working example I'd need to include subscribers, configuration etc. as well. The code snippet is just to give an idea of how pyramid_simpleform is used to someone already familiar with Pyramid. It's not a step-by-step tutorial or complete working code, and is reduced for brevity. The use of CSRF, for example, is explained in detail elsewhere on that page.

    That said, there shouldn't be errors (as opposed to omissions) and a link to the "simplesite" example on this repo would be a good idea.

  2. RunDeep reporter

    Hi, One other minor problem that I think qualifies as an error. In the Schema there is an extra statement:

    value = validators.Int(not_empty=True)

    This is why form.validate() was never true, the Mako template only includes name, ${renderer.text("name", size=30)}.

    Thanks, Eric

  3. Log in to comment