Re: Django dynamic form with additional meta data

2011-02-11 Thread ju
I found my mistake i made ___init__ function instead of __init__ :) On Feb 11, 7:06 pm, Shawn Milochik wrote: > You could be missing something, but I don't have enough to go on. Did > you add the field to your template? What do your view and template > look like? -- You received this message be

Re: Django dynamic form with additional meta data

2011-02-11 Thread ju
View = def detail(request, event_id): event = get_object_or_404(Event, pk = event_id) if request.POST : purchaseForm = PurchaseForm(request.POST) #... else: purchaseForm = PurchaseForm() return render_to_response('events/detail.html', {'event': eve

Re: Django dynamic form with additional meta data

2011-02-11 Thread Shawn Milochik
You could be missing something, but I don't have enough to go on. Did you add the field to your template? What do your view and template look like? -- 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

Re: Django dynamic form with additional meta data

2011-02-11 Thread ju
I tried to make this small example form from django import forms class PurchaseForm(forms.Form): email = forms.EmailField() #agree = forms.BooleanField() def ___init__(self, *args, **kwargs): super(PurchaseForm, self).__init__(*args, **kwargs) self.fields['agree'] = f

Re: Django dynamic form with additional meta data

2011-02-11 Thread Shawn Milochik
This is pretty easy. Instead of thinking about making dynamic forms, think about making dynamic fields. You'll have one form. When you initialize it, you'll pass it information about the tickets available. In the __init__ of your form you will dynamically add field objects to the form by appending