Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-19 Thread Benjamin Dauer
Hi Sergiy, Thanks for your help! 1) I tried overriding the GET request as you suggested and the print statement never went through. It looks like by default it calls `get_object()`, and my `get_object()` code is running, so I'm not sure why it doesn't appear. 2) The form is appearing with the

Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-19 Thread Benjamin Dauer
Hi Sergiy, Thanks for your help! 1) I tried overriding the GET request as you suggested and the print statement never went through. It looks like by default it calls `get_object()`, and my `get_object()` code is running, so I'm not sure why it doesn't appear. 2) The form is appearing with the

Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-18 Thread Sergiy Khohlov
Hello, I had a similar problem (but I'm using DetailView for sending some additional data) and I hope I can help Usually editing page is using GET for receiving default data and POST for sending data from form to view ( we are skipping ajax way) 1) You would like to set initial data to

Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-18 Thread Melvyn Sopacua
On Wednesday 18 January 2017 14:26:52 Benjamin Dauer wrote: > 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

Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-18 Thread Benjamin Dauer
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,

Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-18 Thread Melvyn Sopacua
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

prepopulate form with model instance values using UpdateView and ModelForm

2017-01-18 Thread dauer.benjamin
Hey folks, 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. I've googled around a lot, couldn't find a plug n' play solution. I have a partial solution but it

Re: Prepopulate form from URL?

2009-03-18 Thread Jorge Romo
Thank you so much to both of you! I was looking at the wrong documentation lol kudos! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Prepopulate form from URL?

2009-03-18 Thread Johan
You should be able to do it via foo_value = request.GET['foo']. PS: The above should work for a post like /?foo=bar On Mar 18, 4:06 pm, Jorge Romo wrote: > Hello! > > I was trying to see if there's a way (I'm pretty sure there is a way) > to prepopulate a form field

Re: Prepopulate form from URL?

2009-03-18 Thread Briel
Hi. When you setup urls, they can have dynamic parts in them, so you dont need to use ?=, but could have an url foo/bar where your url would grab the bar and turn it into a variable. Fx if you had an url like this in your urls.py: (r'^foo/(?P\w+)/$', 'my_view_name') bar would become my_var, that

Prepopulate form from URL?

2009-03-18 Thread Jorge Romo
Hello! I was trying to see if there's a way (I'm pretty sure there is a way) to prepopulate a form field from an url. For example: /foo?=bar and that in my form field "bar" is displayed. I have to work with java? there is another way? --~--~-~--~~~---~--~~ You

Re: Prepopulate Form

2006-10-29 Thread Jure Čuhalev
On 10/29/06, shidan <[EMAIL PROTECTED]> wrote: > > Hi, I want the same functionality as the ChangeManipulator where it > prepopulates the form with > the current values of the object, how can I do this with custom form > manipulator. Add flatten_data to it and call if when initializing

Prepopulate Form

2006-10-28 Thread shidan
Hi, I want the same functionality as the ChangeManipulator where it prepopulates the form with the current values of the object, how can I do this with custom form manipulator. Shidan --~--~-~--~~~---~--~~ You received this message because you are