As a first guess I'm not sure that user = User is doing what you would
want.  I think instead you want to instantiate a new User object.  All
you are doing right now is creating an alias user for User.

On Aug 19, 3:16 pm, MikeHowarth <[EMAIL PROTECTED]> wrote:
> Hi I was wondering whether anyone can help me out.
>
> I'm currently creating a form to register users, what I'm finding is
> that when I then attempt to save the user within the Register:save
> method I'm getting an attribute error when trying to access the title
> attribute. I've tried referencing both title, and self.title to no
> avail.
>
> Can anyone advise me on where I'm going wrong with this?
>
> class Register(forms.Form):
>
>         def __init__(self, data=None, request=None, *args, **kwargs):
>                 if request is None:
>                     raise TypeError("Keyword argument 'request' must be 
> supplied")
>                 super(Register, self).__init__(data, *args, **kwargs)
>                 self.request = request
>
>         #personal information
>         title = forms.ChoiceField(choices=titlechoice)
>
>         def save(self):
>
>                 #set up the objects we are going to populate
>                 user = User
>                 user.title = self.title


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to