Questions tagged [deform]

Deform is a Python HTML form generation library. It runs under Python 2.x, 3.x, and PyPy and PyPy3. Forms are built with Colander schemas, uses Peppercorn for de/serialization, and Chameleon for templating.

Deform is a Python HTML form generation library. It runs under Python 2.x, 3.x, and PyPy and PyPy3. It is one of several web-related projects under the Pylons Project.

A demonstration of Deform is hosted by the Pylons Project.

Deform uses Colander as a schema library, Peppercorn as a form control deserialization library, and Chameleon (see ) to perform HTML templating.

Deform depends only on Peppercorn, Colander, Chameleon, and an internationalization library named translationstring, so it may be used in most web frameworks (or antiframeworks) as a result.

Alternate templating languages may be used, as long as all templates are translated from the native Chameleon templates to your templating system of choice and a suitable renderer is supplied to Deform.

72 questions
9
votes
1 answer

How to make file upload facultative with Deform and Colander?

I would like to render a form containing a sequence of files, representing different images of a product. Providing files should be facultative, so the form should validate even in the absence of files. How can I do this ? Here is the colander…
ascobol
  • 7,554
  • 7
  • 49
  • 70
8
votes
2 answers

Deform/Colander validator that has access to all nodes?

How do you define a custom validator in Deform/Colander that has access to all node values. I need to access the values from two fields in order to decide if a particular value is valid or not?
user2665694
6
votes
3 answers

using query string in Python Pyramid route configuration

this is very specific to what I am trying to do so I start describing what it is: a Pyramid app serving plots like http://localhost:6543/path/to/myplot/plot001.png if the plot is not available another image is served (work.png) another part is the…
moin moin
  • 2,263
  • 5
  • 32
  • 51
6
votes
1 answer

deform File Upload overrides my error message with Invalid pstruct: not a FieldStorage instance

If I do not select a file and just click 'submit', I get the following error:- Invalid pstruct: {'upload': "b'' is not a FieldStorage instance"} This is not the behavior I get on the deform demo site where leaving it empty results in the more…
Ng Oon-Ee
  • 1,193
  • 1
  • 10
  • 26
5
votes
1 answer

Allow raw HTML in Deform form description fields

How would you stop Deform from escaping HTML in field titles or descriptions when rendering? My current best solution is to search/replace the returned rendered HTML string with what I need. Deform by default will escape all HTML characters to HTML…
Oli
  • 1,335
  • 1
  • 9
  • 10
4
votes
1 answer

Working with Many to Many Relationships in Deform/Colander HTML Select Field

I'm working in the Pyramid framework and using the Deform package to render HTML forms given a colander scheme. I'm struggling to get my head wrapped around how to handle a schema with a many to many relationship. For example, my sqlalchemy models…
dhildreth
  • 637
  • 1
  • 6
  • 15
4
votes
1 answer

Report form post-process error messages in HTML controls with Deform

Deform allows to add validation on different fields of a form. However, it checks that the form is valid in itself but that does not necessarily mean that the form processing will be valid. For example, if the form is for creating a new user with an…
user1919510
3
votes
1 answer

Is there a way to make a deform/colander form field read-only/disabled?

I'm trying to use deform as part of pyramid and have no trouble getting fully editable or fully read-only forms, but I can't seem to find a way of creating a read-only text input field. The following code does not do what I want, but I think you…
d0nut
  • 610
  • 5
  • 5
3
votes
1 answer

Deform 2.0: Adding HTML5 placeholder

I am trying to add HTML5 placeholder attribute to Deform 2.0 TextInputWidget. However I am not sure if this should be supported or how this should be supported as documentation is not very clear about this - there seems to be some mask_placeholder…
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
3
votes
2 answers

Sharing objects between view and application with Pyramid

I'm trying to create a web interface for a data analysis pipeline using Pyramid. I'm using deform and colander to make the forms. I've been adapting this example: http://pyramid-tutorials.readthedocs.org/en/latest/humans/security/step02/ Most of the…
ate50eggs
  • 444
  • 3
  • 14
3
votes
2 answers

How do you place a Bokeh chart within a Chameleon template?

I have a project with many scripts using Matplotlib. I'd like to build a web interface for this project. How do you place a Bokeh chart within a Chameleon template? I'm using Pyramid and the Deform bootstrap if that matters. Does anyone have a…
EnergyGeek
  • 271
  • 1
  • 4
  • 14
3
votes
2 answers

Which one is the correct approach for form validation ? Colander's Schema validation or Deform's form validation?

I have just started using Pyramid for one of my projects and I have a case where in I need to validate a form field input, by taking that form field value and making a web-service call to assert the value's correctness. Like for example there is a…
Nanda Kishore
  • 2,789
  • 5
  • 38
  • 61
3
votes
1 answer

How to custom the deform Form?

When I use the default deform Form. It's not what I need. How to custom it ? For example, I need this: firstname:[_______] lastname:[_______] *username: [____________________] alink where [__] represent normal html input. Should rewrite the…
Alex Chan
  • 1,116
  • 3
  • 15
  • 33
2
votes
1 answer

How to do simple value check with error message in Deform/Colander

I'm implementing a simple 'tick to agree to terms and conditions box' in Deform/Colander. So, I simply want to check that the box is checked and have an error message saying 'You must agree to T&C'. I understand that I can…
somewhatoff
  • 971
  • 1
  • 11
  • 25
2
votes
1 answer

Is there a way to map data from form to insert in to database without explicitly defining each variable?

I have made a really long form with the help of colander alchemy and deform. This form has 100 or so fields and currently the only way I know to add the data back to the database once form is submitted is to explicitly re-define each variable and…
1
2 3 4 5