On Fri, 2007-06-15 at 18:24 -0700, [EMAIL PROTECTED] wrote:
> Say we have class MyForm with IntegerField called 'year'. When we
> instantiate MyForm, say a = MyForm() we can get it rendered in html
> before passing to template - a.as_table(); This will contain all
> errors, previously entered data - if we instantiate MyForm from
> request.POST.
> The question is, how to get rendered field? I mean, only rendered
> field 'year' without the rest of the form?
> We can pass a.base_fieds['year'] to template - but how to do this
> before rendering the template?
> What I found out is that there is a class called BoundField and we can
> get it via unicode(a['year']) - however, this renders widget only,
> without data or errors. How to display them?
> Of course I can get rendered template and then work with it - but due
> to specific of my app, it raises UnicodeDecodeError, because it gets
> merged with non-unicode string afterwards.

Have a look at Form._html_output() and you can see how the form gets all
the information it needs.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to