--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/1d84a32c-d70a-4d42-8b94-ca19f27ede0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Brock,Yes, that's the intended behavior, and you can see the same behavior on a regular form, without using formsets, which might make it a little more clear what's going on:class MyForm(forms.Form):name = forms.CharField()form = MyForm(initial={'name': 'test'})form.initial #yields {'name':'test'}form['name'].initial #yields 'test'form.fields['name'].initial #yields NoneThe field itself is shared between all instances of MyForm, so passing in initial data to one instance of MyForm shouldn't modify the field. Instead, the BoundField is used to hold the data for a particular form, and as you mention, as the initial value on the boundfield has that value you expect.Hope this helps,Collin
On Wed, May 23, 2018 at 2:04 PM, Brock Hallenbeck <bhallen...@gmail.com> wrote:
When creating a formset using modelformset_factory and passing in a list of dictionaries to use as initial values, those values can be retrieved from the relevant form, and the relevant boundfield on that form.However the formfield class itself has no knowledge of that initial data.Is this intended behavior? I feel like I should be able to catch that initial value in my formfield subclasses.Here is a dpaste illustrating what I am talking about:
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.