I exactly do like when I use Django 0.96.
for example this:
Class AccountAdd(forms.Form):
accountNo = forms.IntegerField(min_value=1, required=True,
widget=forms.TextInput(attrs={'size':'10'}))
def __init__(self, data=None, auto_id='id_%s', prefix=None,
initial=None, instance=None):
self.instance = None
super(AccountAdd, self).__init__(data, auto_id, prefix,
initial)
and in views I use it as:
if request.POST:
# If data was POSTed, we're trying to edit account
newData = request.POST.copy()
f = AccountAdd(newData) # Instantiate and load POST
data
# Check for errors.
if f.is_valid():
# if data is valid, save data
account = f.save()
else:
f = AccountAdd()
Do you know what is the problem?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---