can we use clean method instead of __init__

On Mon 5 Nov, 2018, 4:47 PM Aashutosh Rathi, <aashutoshra...@gmail.com>
wrote:

> Yes, this works for me.
> Make sure
>
>
> super(AddLabForm, self).__init__(*args, **kwargs)
>        fields_keyOrder = ['id', 'date', 'start_time', 'end_time']
>        if 'keyOrder' in self.fields:
>            self.fields.keyOrder = fields_keyOrder
>        else:
>            self.fields = OrderedDict((k, self.fields[k]) for k in
> fields_keyOrder)
>
>
>
>
> On Thursday, January 22, 2015 at 1:06:59 AM UTC+5:30, Tobias Dacoir wrote:
>>
>> It still complained about the request, but I was finally able to get it
>> to work using this code:
>>     def __init__(self, request, *args, **kwargs):
>>         super(CustomContactForm, self).__init__(request=request, *args,
>> **kwargs)
>>         fields_keyOrder = ['name', 'reason', 'email', 'body']
>>         if (self.fields.has_key('keyOrder')):
>>             self.fields.keyOrder = fields_keyOrder
>>         else:
>>             self.fields = OrderedDict((k, self.fields[k]) for k in
>> fields_keyOrder)
>>
>>
>> However it still does not re-order the fields, I searched stackoverflow
>> again and found this for Django 1.7:
>> https://github.com/pennersr/django-allauth/issues/356#issuecomment-24758824
>> But it still does not work. The order doesn't change it all. sigh :(
>>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/67309700-3cfc-4199-a789-8bc8653b1022%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/67309700-3cfc-4199-a789-8bc8653b1022%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF2Ah_HQqXkmMectBBUJkwJdYZLfbe8Qr6FBqQKwPxJ2Ln6MWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to