Changes between Version 18 and Version 19 of NewbieMistakes


Ignore:
Timestamp:
Jan 16, 2006, 10:40:15 PM (18 years ago)
Author:
Tim Keating
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NewbieMistakes

    v18 v19  
    136136
    137137Since a tuple is expected but a string provided, the code will merrily iterate over the characters of the string instead of the tuple elements - and that's where the single-char attribute names come from. If the commas are consistently causing you problems, try using brackets [] instead of parentheses.
     138
     139== I'm using formfields.FormWrapper and none of my form fields show up ==
     140
     141==== Problem ====
     142
     143You are using code similar to that documented [http://www.djangoproject.com/documentation/forms/ here], but when you put {{ form.field_name }}, you get nothing. 
     144
     145==== Solution ====
     146
     147Make sure when you create your form object, you are passing in empty '''dictionaries''', not tuples. For example:
     148{{{
     149    manip = things.AddManipulator()
     150    form = formfields.FormWrapper(manip, {}, {})
     151}}}
     152
     153Not:
     154
     155{{{
     156    manip = things.AddManipulator()
     157    form = formfields.FormWrapper(manip, (), ())
     158}}}
     159If you pass in empty tuples for data & errors, it will silently fail to insert your form fields.
Back to Top