Hi Melvyn,

That's exactly what I'm trying to do, but prior to making the changes it
wasn't prepopulating. At each stage I tested and was getting blank fields
albeit based off of the correct model.

Maybe it's because I don't provide the pk in the URL? I was trying to avoid
that.

On Wed, Jan 18, 2017 at 8:50 AM Melvyn Sopacua <m.r.sopa...@gmail.com>
wrote:

>
>
> On Wednesday 18 January 2017 04:44:01 dauer.benjamin wrote:
>
>
>
>
>
> > Question for you all. Appreciate any insight you can give. So I have a
>
>
> > class-based view (UpdateView) and a ModelForm. I want the form to
>
>
> > pre-populate with data from a model instance.
>
>
>
>
>
> It feels like you're doing work that's already done properly when you
> setup your URLs right.
>
>
> The operations work like this:
>
>
>
>    - Create view: doesn't get an instance ID (but creates one) and fills
>    form with values set by defaults keyword argument on model fields.
>
>    - Update view: gets an instance ID and fills it with field values from
>    the instance. Any missing values get assigned defaults.
>
>    - Delete view: gets an instance ID and removes it. Field values
>    typically do not come into play.
>
>
>
> Does this conflict with what you're trying to accomplish?
>
>
> --
>
>
> Melvyn Sopacua
>
>
>
>
>
>
>
>
> --
>
>
> 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+unsubscr...@googlegroups.com.
>
>
> To post to this group, send email to django-users@googlegroups.com.
>
>
> Visit this group at https://groups.google.com/group/django-users.
>
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2825798.hbvF57IJau%40devstation
> <https://groups.google.com/d/msgid/django-users/2825798.hbvF57IJau%40devstation?utm_medium=email&utm_source=footer>
> .
>
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
Sent from Gmail Mobile

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BeihEggfMN6xv_6%2B3sNM4ZuV%3Dnd7gD7jw0SukDNv5uWf%2Bwr_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to