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...

Flask Python Model Validation

Coming from a php background, I am learning python through Flask. I have used WTForms for the client, and this handles validation nicely. However, one of the things that I would like to use flask...

Rename deseralized fields in Colander

I'm using Colander to convert JSON strings to Python Objects and vice versa in a Pyramid/Cornice based project. Is there any way that you can serialize/deserialize to different names/keys ? Here...

Colander: how do I allow None values?

Say I have a simple schema: class MySchema(colander.MappingSchema): thing = colander.SchemaNode(colander.Int()) With the schema above, when trying to deserialize {'thing': None} I get the...

How to use lists or arrays in Colander forms

How can I send lists/arrays in POST forms and get them decoded with Colander? I've tried in several ways but no luck so far. Using a form and Colander schema like the following will throw the...

Validate optional values with Colander

I'm using Colander to validate request parameters for a Pyramid web server. For example: class MySchema(colander.MappingSchema): first_name =...

How to conciliate REST and JSONschema?

I'm starting a new project that consists in an Extjs 6 application with a pyramid/python backend. Due to this architecture, the backend will only provide an RPC and won't serve any page directly....

Colander schemanode SelectWidget with "Select All" button

I just started working with the colander schemes; with the select multiple select Widget. How can I add a button "select all" that will select all options?

Colander deform file upload widget

I want to upload a single file with the following colander schema: import colander import deform from deform.interfaces import FileUploadTempStore @view_config(route_name='upload', ...

Dynamic forms with deform

Making form with deform and whould like to change the pageShema class depending on the choices made by the user. Ex. if he selects option 1 from selectwidget, show him one set of fields, if case...

How to create tuples from two columns with sqlalchemy, populate deform select widget from database

The deform select widget takes a sequence of two element tuples. How do I create two element tuples from two columns from an sqlalchemy query. The below code works with the hardcoded...

Python data validation with multiple possible keys per entry

I am trying to write a data deserializer/validator in python. I have looked at several python tools for this, principally colander and voluptuous. My input data will always be in JSON...

How to convert a datetime from one arbitrary timezone to another arbitrary timezone

Let's say I receive an arbitrary datetime object in a request, like this, which could be coming from any possible timezone - I don't know which one. For the sake of example, pretend it comes from...

Validating React forms with Cornice/Colander/Pyramid

We are using Cornice for server-side REST API. Frontend is using React. We'd like to have frontend forms to post to Cornice and give proper validation results. Are there any standard practices of...

Save deform.FileData schema node as file

My script is exactly as the Deform File Upload Widget example: @view_config(renderer='templates/form.pt', name='file') @demonstrate('File Upload Widget') def file(self): class...

virtualenv and git repo development vs production best practice

what would be the best practice to maintain the pip requirements.txt for pkg1 , the git repo with following content repo/pkg1 repo/pkg2 repo/pkg3 repo/pkg4 all packages are checked in one repo and...

How to write a regular expression in Python that accepts alphabets, numbers and a few selected special characters(,.-|;!_?)?

A Regular Expression in Python that accepts letters,numbers and only these special characters (,.-|;!_?). I have tried solving the problem through the following regular expressions but it didn't...

Angular 2 component doesn't work with my javascript

I noticed that if I write datepicker in the index.html file then jquery knows how to handle it but if the same element is part of angular component then clicking on it will not open the colander...

Pyramid with Deform not rendering properly. Rendered as pure string

I am trying out pyramid with deform. However the form is not rendered as form but a pure string @view_config(route_name='sign_up', renderer='templates/sign_up.jinja2') def sign_up(request): ...

Accessing a key value pairs in a JsonResponse in Django Unit Testing

I want to access the data returned in the following jsonResponse object: {"results": [[1, "Probability and Stochastic Processes", 9781118324561, "Roy D. Yates", "2014-01-01", "Wiley"], [2,...

How do you validate application logic using Pyramid's Colander?

So far I am using colander to validate the data in my aiohttp application. The problem I face is that I don't know how to do "deep" validation. Given the following schema: import colander class...

Syntax: Applying IF to a cell range in Excel

I've been trying to write a formula to summarise in one cell the presence/ absence of certain values in a different range of of cells in Excel So in the one table and worksheet, I...

Adding CSS to Deform Input Form

I am implement a simple form with Colander and Deform; however, I wish to override the default stylsheet and provide my own. However, I have no idea on how to provide my own styling for the form....

Optional Colander Field for object instantiated using custom class

I want to make certain fields in a model made using colander to be optional. I am familiar with using missing=colander.drop but that only works when SchemaNode is defined. In case, the field is...

loop through implicit array

I've been stuck on this for awhile now. I'm trying to loop through this array so I can perform some calculations but I cannot figure out how to loop through there values. Any suggestions? I...

How to transform JSON data in webpage and put the data to specific div?

I am new to front-end, I have been looking for hints/relevant solutions in the past few weeks but still no luck. I hope I can solve it out here...I am currently building my first website. I am...

Accepting lists as URL params with Colander

I'm trying to accept a URL-serialized version of the following Python dict using Colander as my validation backend: {'foo': [1,2,3]} The way I've approached this was primarily using...

How to format dates in colander validator?

User Pyramid, Colander, and Deform, I've got a datetime widget. datetime_event = colander.SchemaNode( colander.DateTime(), validator=colander.Range( min=datetime( 2018,...

How to deserialize json with optional fields using attrs and cattrs

I want to deserialize MongoDB documents using attr and cattrs. Since noSQL has no fixed schema, I need to point somehow to the attr.ib-s that they could be missed, and not add them to the dict's...

Is it possible to use multiple forms with one submit button? I am using pyramid and deform

I have created 2 colander schemas as these reflect my database structure. I want to present both forms on one page with one submit button instead of two so that when submit is pressed it will...