i'm sorry,but i don't understand the question.
the model is only an example. My idea is a model like this:

------------------------------------------------------------------------------
class Format(models.Model):
    code = models.CharField(max_length=10)
    name = models.CharField(max_length=30)
    weight = models.PositiveSmallIntegerField()
......
------------------------------------------------------------------------------

the field code can only be edited when a new row is inserted. After
that the code must be displayed like a label or information,to inform
at the user the row that is editing.
--------------------------------------------------------------
formset
<tr>
  <td>Code 1 </td><td><input text value="John1" name="name..."/><input
text value="100" name="weight..."/></td>
</tr>
<tr>
  <td>Code 2</td><td><input text value="Jack" name="name..."/><input
text value="105" name="weight..."/></td>
</tr>
.....
--------------------------------------------------------------
I want to know if i can get the code list in the same instance where
the form is filled, or how i can do something like {{ fieldcode|id }}
or {{ fieldcode.id }} in the template?

Best regards

On 13 ago, 02:16, Boguslaw Faja <zy...@zymen.net> wrote:
> Hi,
>
> fast question: why fields = ['nombre'] instead of fields = ['name2'] ?
>
> Best regards
>
>
>
> On Wed, Aug 11, 2010 at 3:59 PM, refreegrata <refreegr...@yahoo.com> wrote:
> > with a model like this:
> > --------------------------------------
> > class Format(models.Model):
> >    name1 = models.CharField(max_length=5)
> >    name2 = models.CharField(max_length=5)
> > --------------------------------------
>
> > and a modelform like this:
> > -----------------------------------------------------
> > MyForm(forms.ModelForm)
> >   class Meta:
> >        model = Format
> >        fields = ['nombre']
> > -----------------------------------------------------
>
> > this code will generate 2 "input text", the "input text" name1 and the
> > "input text" name2. But for an unique modelform from the model
> > "format" i want an "input text"(name2)  and a "label" or
> > "text"(name1), because the field "name1" can only be edited in the
> > first time.  In any other occasion the field "name1" most be displayed
> > like an info about de field "name2"
>
> > I do not know if you understand my question. basically is ¿ how i can
> > supply info about a row of mi table for a specific form of my formset?
>
> > example
> > normaly my html page is
> > -----------------------------------------------
> > formset
> > <tr>
> >  <td><input text value="Alex" name="name1..." /></td><td><input text
> > value="Oscar" name="name2..."/></td>
> > </tr>
> > <tr>
> >  <td><input text value="John" name="name1..." /></td><td><input text
> > value="Jack" name="name2..."/></td>
> > </tr>
> > .....
> > -----------------------------------------------
> > but i want something like this
> > -----------------------------------------------
> > formset
> > <tr>
> >  <td>"Alex" </td><td><input text value="Oscar" name="name2..."/></td>
> > </tr>
> > <tr>
> >  <td>"John"</td><td><input text value="Jack" name="name2..."/></td>
> > </tr>
> > .....
> > -----------------------------------------------
>
> > Thanks for read
>
> > P.D.: sorry for mi poor english
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> Bogusław Faja
> tel. (+48) 691544955

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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