| | 2604 | Labels for as_* methods will only end in a colon if they don't end in other |
|---|
| | 2605 | punctuation already. |
|---|
| | 2606 | >>> class Questions(Form): |
|---|
| | 2607 | ... q1 = CharField(label='The first question') |
|---|
| | 2608 | ... q2 = CharField(label='What is your name?') |
|---|
| | 2609 | ... q3 = CharField(label='The answer to life is:') |
|---|
| | 2610 | ... q4 = CharField(label='Answer this question!') |
|---|
| | 2611 | ... q5 = CharField(label='The last question. Period.') |
|---|
| | 2612 | >>> print Questions(auto_id=False).as_p() |
|---|
| | 2613 | <p>The first question: <input type="text" name="q1" /></p> |
|---|
| | 2614 | <p>What is your name? <input type="text" name="q2" /></p> |
|---|
| | 2615 | <p>The answer to life is: <input type="text" name="q3" /></p> |
|---|
| | 2616 | <p>Answer this question! <input type="text" name="q4" /></p> |
|---|
| | 2617 | <p>The last question. Period. <input type="text" name="q5" /></p> |
|---|
| | 2618 | >>> print Questions().as_p() |
|---|
| | 2619 | <p><label for="id_q1">The first question:</label> <input type="text" name="q1" id="id_q1" /></p> |
|---|
| | 2620 | <p><label for="id_q2">What is your name?</label> <input type="text" name="q2" id="id_q2" /></p> |
|---|
| | 2621 | <p><label for="id_q3">The answer to life is:</label> <input type="text" name="q3" id="id_q3" /></p> |
|---|
| | 2622 | <p><label for="id_q4">Answer this question!</label> <input type="text" name="q4" id="id_q4" /></p> |
|---|
| | 2623 | <p><label for="id_q5">The last question. Period.</label> <input type="text" name="q5" id="id_q5" /></p> |
|---|
| | 2624 | |
|---|