Sir, I just re-examined my code and realized that the integers I was plugging into `initial` was the wrong value, semantically speaking. IDs from the wrong model were being used for initial values... Simplifying my example for this explanation helped me see that pretty quickly when I pulled my code up just now.
Thanks for the second pair of eyes! I knew of course that the `initial` keyword argument worked in my other views, but I doubted myself. Surprising how many really lame mistakes you can make even after a couple years of using Django every day! Tim On Sun, Oct 17, 2010 at 08:38, Tim Valenta <tonightslasts...@gmail.com> wrote: >> The only thing I can think of is that the choices for the field are >> not being set correctly to start with - in the bit where you write >> `(choices=[yada yada]`, what is 'yada yada'? Obviously, this must >> contain *all* possible values for the codes across all responses, so >> that the relevant ones can be selected for each item in the formset. > > I had shortened it because it was a gross little bit of code which > effectively takes a queryset of another model and turns them into a > customized "choice" strings. The result is just a giant tuple of (id, > "name") pairs, where the `id` is the value I'm interested in injecting > into the `codes` field. You are right about it needing to contains > *all* possible codes. > > Did your test work for just `extra` forms, or did it also work out for > existing instances? The part that kills me as I test is that I have > poked around in the field object after I try to set the `initial` > values, and my inserted ids are there among the other initial values > from the instance value, yet `codes` would just not show up on my the > form. > > If it works for you, then I really need to break this down and examine > more contextual details! > > Thanks for the input. > -- 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.