On 12/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > If there's one more suggestion that I can make...when creating models, > there's a separate CharField and TextField. In newforms, it seems that > there's no such distinction, so an as_textarea function determines its > display (if I'm seeing this correctly). Maybe separating that out in > form creation would be a good idea too.
Yeah, I gave that some thought and figured the only difference between a database CharField and TextField is the *display*. Validation-wise, both are text, which may or may not have a max_length. So in the forms system, you can just use CharField for both, passing in the appropriate widget if you need it displayed as a <textarea>. One more thing on the to-do list is a function that automatically creates a form given a model class, and it'll perform the mapping of database CharFields/TextFields to the appropriate form field and widget types -- so you won't have to worry about that distinction once that helper function is in place. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
