Why are you talking to me? I'm not OP xD

On Thu, Apr 16, 2015 at 9:57 AM, Pavel Kuchin <pavel.s.kuc...@gmail.com>
wrote:

> Hi Vijay,
>
> Looks like Django does not use SortedDict anymore
> (
> https://github.com/django/django/commit/07876cf02b6db453ca0397c29c225668872fa96d#django/forms/forms.py
> )
> The self.fields.keyOrder does not work anymore, django-userena has an
> obsolete documentation.
> Try to remove def __init__(self, *args, **kw): from your class,
> ordering should be based on fields definition order.
>
> Best regards,
> Pavel
>
> 2015-04-16 15:31 GMT+03:00 Vijay Khemlani <vkhem...@gmail.com>:
> > In the title: "'OrderedDict' object has no attribute 'keyOrder'"
> >
> > On Thu, Apr 16, 2015 at 6:13 AM, Pavel Kuchin <pavel.s.kuc...@gmail.com>
> > wrote:
> >>
> >> Hi Willy,
> >>
> >> Can you send an error, because I see only the SignupFormExtra class.
> >>
> >> Yours sincerely,
> >> Pavel
> >>
> >> четверг, 16 апреля 2015 г., 1:41:47 UTC+3 пользователь willyhakim
> написал:
> >>>
> >>> Hi everyone,
> >>> I am using django-userena and extend the form class to add some of my
> own
> >>> fields. I followed
> >>> the demo and still get the above error. Anyone know what I am doing
> >>> wrong?
> >>>
> >>> class SignupFormExtra(SignupForm):
> >>>     """
> >>>     A form to demonstrate how to add extra fields to the signup form,
> in
> >>> this
> >>>     case adding the first and last name.
> >>>
> >>>     """
> >>>     first_name = forms.CharField(label=_(u'First name'),
> >>>                                  max_length=30,
> >>>                                  required=True)
> >>>
> >>>     last_name = forms.CharField(label=_(u'Last name'),
> >>>                                 max_length=30,
> >>>                                 required=False)
> >>>     industry = forms.CharField(label=_(u'Industry'),
> >>>                                     max_length=50,
> >>>                                     required=False)
> >>>     title = forms.CharField(label=_(u'title'),
> >>>                                     max_length=50,
> >>>                                     required=False)
> >>>
> >>>     def __init__(self, *args, **kw):
> >>>         """
> >>>
> >>>         A bit of hackery to get the first name and last name at the top
> >>> of the
> >>>         form instead at the end.
> >>>
> >>>         """
> >>>         super(SignupFormExtra, self).__init__(*args, **kw)
> >>>         # Put the first and last name at the top
> >>>         new_order = self.fields.keyOrder[-2]
> >>>         new_order.insert(0, 'first_name')
> >>>         new_order.insert(1, 'last_name')
> >>>         new_order.insert(2, 'industry')
> >>>         new_order.insert(3, 'title')
> >>>         self.fields.keyOrder = new_order
> >>>
> >>>     def save(self):
> >>>         """
> >>>         Override the save method to save the first and last name to the
> >>> user
> >>>         field.
> >>>         """
> >>>         # First save the parent form and get the user.
> >>>         new_user = super(SignupFormExtra, self).save()
> >>>
> >>>         new_user.first_name = self.cleaned_data['first_name']
> >>>         new_user.last_name = self.cleaned_data['last_name']
> >>>         new_user.industry = self.cleaned_data['industry']
> >>>         new_user.title = self.cleaned_data['title']
> >>>         new_user.save()
> >>>
> >>>         # Userena expects to get the new user from this form, so return
> >>> the new
> >>>         # user.
> >>>         return new_user
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Django users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to django-users+unsubscr...@googlegroups.com.
> >> To post to this group, send email to django-users@googlegroups.com.
> >> Visit this group at http://groups.google.com/group/django-users.
> >> To view this discussion on the web visit
> >>
> https://groups.google.com/d/msgid/django-users/a4c2a9d4-b9f2-43bc-b7bc-537e9e17c88b%40googlegroups.com
> .
> >>
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to a topic in the
> > Google Groups "Django users" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/topic/django-users/5HxEahhNuSo/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> > django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/CALn3ei0YPZWLO7wZH7sxw98xQ_vLxpARBUmUUz0-eR8sXkiUjQ%40mail.gmail.com
> .
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALyspwpeBLMTdy%2BxBEoUL_Zb334EZnBDE4v0ADk7Ls57DCUSzw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALn3ei0nyheSe%2BYRs6sNbunfGQpb6tJ1cgjSGsicG4oKmT9Sqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to