Malcolm Tredinnick schreef:
>>
>> In general, we want like to avoid putting presentation related
>> information into models, since they should be presentation independent
>> as much as possible. The fact that we haven't avoided that entirely so
>> far isn't an excuse to slide further down that slope.
> 
> Sorry, I should clarify this slightly, since I was about to go to sleep
> when I wrote it and I was lazy with words. Previous conversations were
> about trying to keep large amounts of presentation configuration out of
> the field definitions. It may be that having an inner class to define
> the default presentation in some way is an option (although I'm
> personally not that keen on that one) -- one of the unresolved points
> previously was for people to come up with some plausible alternatives.
> This all hooks in a bit with how default forms are constructed from
> models (currently default manipulators -- in a few months... *shrug*),
> so it's not a ten minute problem.
> 
> Regards,
> Malcolm


Malcolm,

thanks for the explanation. I agree that presentation should be kept out
of it as much as possible but it wasn't clear to me on how i could
change the code to get a textarea instead of a input field and then also
customize the textarea.

Those issues are actually solved by using the TextField instead of
CharField in my model and as Rajesh pointed out, using an inline style
like this
<style>
textarea {width: 30em; height: 7em;}
</style>

customizes the textarea. I didn't think of that solution.

Only problem i can see with this, is what if you have different
textarea's that you want to specify the dimensions of?
I actually have a form with 3 textarea's but they can be the same size
so it's not an issue right now. But i can imagine that not all
textarea's are the same size.
The style is used for all textarea's on that page.
It's still not clear to me on how one would adjust the dimension of the
individual textarea's.

I imagine you can use javascript in the onload part of the body that
adjusts the size of the elements on the fly.

Regards,
Benedict


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to