Re: rendering dynamic fields in newforms

2007-02-18 Thread Rubic
On Feb 18, 12:00 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Looks like you are rendering out the form class itself rather than an > instance of the form. Monster, Thanks, but Honza had the correct reply. I need to access the individual fields in the template, and BoundField is the way

Re: rendering dynamic fields in newforms

2007-02-18 Thread [EMAIL PROTECTED]
Jeff, Looks like you are rendering out the form class itself rather than an instance of the form. You could try this approach. from django import newforms as forms from django.template import Context, Template from django.http import HttpResponse class MedForm(forms.Form): def __init__(self,

Re: rendering dynamic fields in newforms

2007-02-17 Thread Honza Král
for rendering you should use BoundField... I use something like this... for s in : name = 'stay_' + str( s.id ) bf = BoundField( self, self.fields[name], name ) output.append( u'%s' % bf ) On 2/17/07, Rubic <[EMAIL PROTECTED]> wrote: > > Hi, I'm th

rendering dynamic fields in newforms

2007-02-16 Thread Rubic
Hi, I'm the 985th person to attempt dynamic fields in newforms. ;-) Actually I've been able to do lots of dynamic stuff in newforms. It's rendering the forms in templates that sometimes confuses me. For example, given the following code to build a form based on an arbitrary number of medicatio