Sorry this was my fault, didn't test my test case. It was a bug in my test
code.
Thanks any way
Vitaly Babiy


On Thu, Jul 16, 2009 at 1:23 PM, Karen Tracey <kmtra...@gmail.com> wrote:

> On Thu, Jul 16, 2009 at 8:53 AM, Vitaly Babiy <vbabi...@gmail.com> wrote:
>
>> Hello everyone,
>> [snip]
>> Now lets try it with a ModelForm
>>
>> class UserForm(forms.ModelForm):
>>     class Meta:
>>         model=User
>>         fields= ('first_name',)
>>
>> >>> form = UserForm()
>> >>> form.is_bound
>> False # this is good
>> >>> form = UserForm({})
>> >>> form.is_bound
>> False # this should be true
>>
>> I am not sure why when you give a model form data it does not become
>> bound.
>>
>> Is this a bug?
>>
>
> I can't recreate this with either current trunk or 1.0.2:
>
> >>> import django
> >>> django.get_version()
> '1.0.2 final'
> >>> from django import forms
> >>> from django.contrib.auth.models import User
> >>> class UserForm(forms.ModelForm):
> ...     class Meta:
> ...         model = User
> ...         fields = ('first_name',)
>  ...
> >>> uf1 = UserForm()
> >>> uf1.is_bound
> False
> >>> uf2 = UserForm({})
> >>> uf2.is_bound
> True
> >>>
>
> What version of Django are you using?
>
> Karen
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to