Re: ModelForms
On Wed, Dec 11, 2013 at 11:22 AM, <giuliano.bertoletti@gmail.com> wrote:
>
> Hello,
>
> when using ModelForms, which is the correct way to implement the "edit item"
> pattern?
>
> Suppose I've a table with many rows, each representing a record in a
> database.
> I choose one and wish to display/let the user edit the details.
>
> I'm trying to use a ModelForm and fill some fields with specific data coming
> froma query.
> The problem is I'm unable to initialize the fields and have the page served.
>
> The arguments taken for a form do not work in a modelform.
A ModelForm operates on an instance of a model. Eg
instance = Quotation(filename='123')
form = QuotationForm(instance=instance)
Cheers
Tom
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1JOxGHQ1i6FHUPgSUTBSKpCYnrK%3De%3D81L9MMCd1wLozAA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home