Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion fields with names that don't match their python attribute names
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
forest  
View profile  
 More options Jul 27 2010, 5:20 pm
From: forest <fore...@gmail.com>
Date: Tue, 27 Jul 2010 14:20:56 -0700 (PDT)
Local: Tues, Jul 27 2010 5:20 pm
Subject: fields with names that don't match their python attribute names
I'm using a service that requires form field names with characters
that are not legal python variable names.  For example:

<input type="text" name="credit_card[billing_address][region]" />

http://www.braintreepaymentsolutions.com/docs/python/credit_cards/cre...

The only way I see to support these field names is to use BaseForm and
give up several of the features that make WTForms so useful.  Is there
a way to define a Form using the normal class-attribute-fields
approach, while assigning each Field a special string to use as its
name when rendering html?

If not, perhaps it would be worth adding, for the sake of easily
handling all the characters allowed by html forms.  I imagine the
interface might something like this:

class MyForm(Form):
  region = TextField( "Region", name="credit_card[billing_address]
[region]")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.