You didn't provide the 'dob' parameter.

On Jun 13, 12:02 pm, Chr1s <[EMAIL PROTECTED]> wrote:
> Hi thanks for your replay,
> It is the second situation, I re-write the form.py like this
>
> class RegistrationForm(forms.Form):
>   ........ (other stuff  )....
> def save(self, profile_callback=None):
>
>         new_user =
> RegistrationProfile.objects.create_inactive_user(username=self.cleaned_data['username'],
>
> password=self.cleaned_data['password1'],
>
> email=self.cleaned_data['email'],
>
> nickname = self.cleaned_data['nickname'],
>
> country = self.cleaned_data['country'],
>
> province = self.cleaned_data['province'],
>
> city = self.cleaned_data['city'],
>
> gender = self.cleaned_data['gender'],
>
> phone = self.cleaned_data['phone'],
>
> bio = self.cleaned_data['bio'],
>
> profile_callback=profile_callback)
>         return new_user
>
> and then I changed the models.py in this way.
>
> def create_inactive_user(self, username, password,
> email,dob,nickname,country,province,
>                              city,gender,phone,bio,send_email=True,
> profile_callback=None):
>         new_user =
> User.objects.create_user(username,last_name,first_name, email,
> password)
>         new_user.is_active = False
>         new_user.save()
>
>         registration_profile = self.create_profile(new_user)
>         userdetail =
> UserDetail(new_user,nickname,dob,country,province,city,gender,phone,bio)
>         userdetail.save()
>         if profile_callback is not None:
>             profile_callback(user=new_user)
>
> but the browser throw the error like this
>
> TypeError at /veryuser/register/
> create_inactive_user() takes at least 12 non-keyword arguments (4
> given)
>
> thanks
>
> On Jun 13, 5:17 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
>
> > 2008/6/13 Chr1s <[EMAIL PROTECTED]>:
>
> > > But still I don't know how to implement this, anyone could give me a
> > > simple example? thanks very much
>
> > This feature is intended for a situation where each of the following is 
> > true:
>
> > 1. You have a custom user-profile model.
> > 2. The user-profile model has been written in such a way that an
> > instance can be created using nothing but default values (e.g., with
> > no input whatsoever from the user).
>
> > If that is the case, simply write a function which can create an
> > instance using nothing but default values, and pass that as the
> > argument.
>
> > If that is not the case, you will either need to write a more complex
> > custom form (to handle any additional information you want to collect)
> > or create the profile in a separate step (e.g., using
> > django-profiles).
>
> > --
> > "Bureaucrat Conrad, you are technically correct -- the best kind of 
> > correct."
>
>
--~--~---------~--~----~------------~-------~--~----~
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