I was able to get the user input back if there are errors but I have a
customized form class which extends the UserCreationForm.  I was
following the example at:

http://www.djangobook.com/en/2.0/chapter14/#cn176

You will notice that if the user inputs are not valid, the view re-
initialize the form object to:

form = UserCreationForm(request.POST)

The above is sent back to the template.  My template looks like the
following and it carries over the user inputs:

        <label for="id_username">Username:</label>
        {{ form.username }}

The form documentation is http://docs.djangoproject.com/en/dev/topics/forms/
I am not sure if you have a customized form class yet but that's how I
would have done it for validation of many input fields.

On May 13, 7:47 am, Miguel <migue...@gmail.com> wrote:
> the problem I have is that the fields are dynamic so I can not do any model
> from a form django object...
>
> Miguel
> Sent from Madrid, Spain
>
> On Wed, May 13, 2009 at 1:27 PM, Miguel <migue...@gmail.com> wrote:
> > ignorance, I guess. Django is a really huge framework and I am new using
> > it.:-s
>
> > Where can I find documentation about how python handle this?
>
> > Miguel
> > Sent from Madrid, Spain
>
> > On Wed, May 13, 2009 at 1:24 PM, Daniel Roseman <
> > roseman.dan...@googlemail.com> wrote:
>
> >> On May 13, 11:59 am, Miguel <migue...@gmail.com> wrote:
> >> > I want to generate the following info in my html:
>
> >> > <input type='text' class='celda_activa' name='dynamic name'
> >>  value='dynamic
> >> > value' >
>
> >> > To do that I proccess the info as follows:
>
> >> >                                         <th>Peso (kg)</th>
> >> >                                         {% ifequal fila.__str__
> >> > metodo.get_unidad_series %}
> >> >                                             {% for serie in
> >> > metodo.get_rango_series_mod_10 %}
> >> >                                                 <td>
>
> >> >                                                     <input type='text'
> >> > class='celda_activa'
> >> > name='peso_{{embebido.id}}_{{ciclo}}_{{fila|get_numero_serie:serie}}'
>
> >> >                                                     {% for evaluacion in
> >> > embebido.get_evaluaciones %}
> >> >                                                         {% ifequal
> >> > serie.__str__ evaluacion.serie.__str__ %}
> >> >                                                             {% ifequal
> >> > ciclo.__str__ evaluacion.ciclo.__str__ %}
>
> >> > value="{{evaluacion.peso}}"
> >> >                                                             {%
> >> endifequal %}
> >> >                                                         {% endifequal%}
> >> >                                                     {% endfor %}
> >> >                                                     {% ifequal accion
> >> "ver"
> >> > %} readonly='readonly'{% endifequal %}
>
> >> >                                                 </td>
> >> >                                             {% endfor %}
>
> >> > when errors occur, the users is sent to the same page but, I want to
> >> fill
> >> > the values the user has already filled. I have these variables names and
> >> > values in the context but how can I replace them if the html inputs are
> >> > dynamic names?
>
> >> > could anybody help me with these? I am a little lost.
>
> >> > Thank you in advance,
>
> >> > Miguel
> >> > Sent from Madrid, Spain
>
> >> As I said on the original thread, the Django forms framework handles
> >> this for you automatically. Is there a reason why you have chosen not
> >> to use it?
> >> --
> >> DR.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to