I have a Pylons app and am using FormEncode and HtmlFill to handle my forms. I have an array of text fields in my template (Mako)
<tr>
<td>Yardage</td>
<td>${h.text('yardage[]', maxlength=3, size=3)}</td>
<td>${h.text('yardage[]', maxlength=3, size=3)}</td>
<td>${h.text('yardage[]', maxlength=3, size=3)}</td>
<td>...
if an exception occurs in form encode then what will be the return type??
suppose
if(request.POST):
formvalidate = ValidationRule()
try:
new = formvalidate.to_python(request.POST)
data = Users1( n_date = new['n_date'], heading = new['heading'],
desc = new['desc'], link...
Problem:
I have a form in TurboGears 2 that has a text field for a list of e-mails. Is there a simple way using ToscaWidgets or FormEncode to chain form validators for Set and Email or will I have to write my own validator for this?
...
Okay, so I've written a REST API implementation using mod_rewrite and PHP. I'm accepting a query string via the body of HTTP DELETE requests (... collective groan?). Arguments about the wisdom of both previous statements aside, what I've found is that PHP doesn't automatically parse the request body of DELETE requests (i.e. $_POST is e...
I'm working in pylons with mako, and I'd like to create forms and validations with FormEncode for several parts of my application. I can't seem to find any good examples of the whole process. My question is twofold:
Technical
FancyValidators and Schemas - Their relationship and syntax
Pylons controllers and mako templates - how ...
Hi Stackoverflow!
I ran up against a few problems with Pylons/Formencode today when it came to validating multiple checkboxes. As a bit of background I have something like this in my Mako template:
<input type="checkbox" name="Project" value="1">Project 1</input>
<input type="checkbox" name="Project" value="2">Project 2</input>
<input ...
Hi, I'm trying to create a simple unique username function for use in a Formencode schema. Here is the function:
class UniqueUsername(formencode.FancyValidator):
def _to_python(self, value, state):
user = DBSession.query(User.user_name).filter(User.username==value)
if user is not None:
raise form...
I am attempting to use the validate decorator in Pylons with FormEncode and I have encountered an issue. I am attempting to validate a form on a controller action that requires parameters, and if the validation fails, the parameters aren't passed back in when the form is re-rendered. Here's an example.
def question_set(self, id):
...
The validate and authenticate_form decorators don't seem to play nice together. This is my template:
<html>
<title>Test</title>
<body>
${h.secure_form('/meow/do_post')}
<input type="text" name="dummy">
<form:error name="dummy"><br>
<input type="submit" name="doit" value="Do It">
${h.end_form()}
</body>
</html>
And this is the controll...
Hi,
Should I use in this case method="post" or method="get" for ajax form submission?
Update:
When should be used post and when get in case of ajax form submission?
<form action="script.php" method="post">
<label>Url: </label>
<input value="http://" id="url-input" type="text" size="100" /><br />
<label>paste html file source: ...
I'm using formencode for validating and submitting forms in my Pylons application. The documentation says that it can be used also for generating forms, but there is no any example. I even found the old topic which says it can be done with
form = HTMLForm(form_template, FormSchema)
form.render()
but for the latest version of formenco...
I have a form that is similar to the following:
Enter Name:
Enter Age:
[add more]
That add more field copies the Name and Age inputs and can be clicked as many times as the user wants. Potentially, they could end up submitting 50 sets of Name and Age data.
How can I handle this received data when it's posted to my Pylons application?...
I've met the same problem as this page:
http://www.mail-archive.com/[email protected]/msg14292.html
This is the main content from there:
I am using formencode to validate my
forms, and I've stumbled upon a
problem. When using tha validator
inside the controller action, I call
to_python() and I can pass the sta...
I'm working on a Pylons-based web app. Because I am sane, I am using jQuery (and plugins) instead of writing raw JavaScript. I am also using FormEncode to validate forms for my app (especially new user registration). FormEncode is great for validating forms after they're submitted. jQuery, when JavaScript is available, validates form...
Hello,
I wanted to create an IDN-aware formencode validator to use in one of my projects. I used a portion of code from the Django project (http://code.djangoproject.com/svn/django/trunk/django/core/validators.py) to do that, but there must be a trivial error in my code I can't find :
class Email(formencode.validators.Email):
def _...
Hi everyone !
How to validate words divided by a comma by FormEncode ?
Something like this:
"foo1, foo2, foo3" -> ["foo1", "foo2", "foo3"]
...