Hi,
I´m working with django 0.96.2 and have a form called LoginForm as
below:
#file formularios.py
from django import newforms as forms
class LoginForm(forms.Form):
email = forms.CharField(max_length=100 )
senha = forms.CharField(widget = forms.widgets.PasswordInput)
url_back = forms.CharField(widget = forms.widgets.HiddenInput)
In a view, I'm trying to set a value in url_back like that:
#File views.py in same folder than formulario.py
from django.http import *
from formularios import LoginForm
from formularios import UploadForm
from django.shortcuts import render_to_response
from models import Usuario
from bo import UsuarioBO
from django.utils.translation import gettext as _
from django.template.context import RequestContext
from django.conf import settings
def login(request, **kwarg):
form = LoginForm()
form.url_back.data = kwarg['url_back']
And I got the following error:
AttributeError: 'LoginForm' object has no attribute 'url_back'
Printing dir(form), the attributes email, senha and url_back aren´t
listed, but when I change LoginForm for not subclassing forms.Form,
they are listed.
Any ideas, pls?
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---