Hi!!! I am having some trouble trying to output a database record to a form!!!!
**My form: class ClientesFIForm(forms.Form): ClienteCodigo = forms.IntegerField(label='Codigo Cliente') ClienteNombre = forms.CharField(label='Nombre Cliente') ClienteFechaCreacion = forms.DateField(widget=AdminDateWidget, label='Fecha', required=False) **In my function view I have: #Update Mode #Estamos procesando un cliente desde la SB clienteBuff = Cliente.objects.filter(pk=request.POST ['LineaGrid']).values('ClienteCodigo', 'ClienteNombre', 'ClienteFechaCreacion') form = ClientesFIForm(clienteBuff) return render_to_response('ControlHoras/ClientesFI.html', {'form': form,}) **In my template: <link rel="stylesheet" type="text/css" href="/media/css/base.css" /> <link rel="stylesheet" type="text/css" href="/media/css/forms.css" /> <script type="text/javascript" src="/admin/jsi18n/"></script> <script type="text/javascript" src="/media/js/core.js"></script> {{ form.media }} <form action="/ControlHoras/ClientesFI/" method="POST" name='FI'> <input type="hidden" name="formaID" id="id_formaID" value="ClientesFI" /><br> {{ form.as_p }} <input type="submit" value="Submit" /> </form> The hidden field is a device to identify the moment the form is submitted: Add mode-> the forms displays blank, Update mode the forms "should" display data... The only thing I am able to see is that QueryList clienteBuff has square brackets... for example: [{'ClienteCodigo': 13L, 'ClienteFechaCreacion': datetime.date(2009, 10, 10), 'ClienteNombre': u'trece'}] Debugging the while the form is being redisplayed because of invalid data, I do not see those brackets. Also, the date appears a a string. Here is an example of the data bound while in add mode: {u'ClienteCodigo': u'aaaa', u'ClienteFechaCreacion': u'2009-10-12', u'ClienteNombre': u'prueba', u'formaID': u'ClientesFI'} Tackling with the binding of the form I have got forms without fields, only the submit button. But I have not being able to get rid of the brackets or datetime.date function... Thank you!!!! --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---