On Thu, Jul 16, 2009 at 8:53 AM, Vitaly Babiy <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---