Re: How to create a password reset for Custom User Model

2021-10-26 Thread Amit Karnam
Thanks for the clarification,  will move the conversation to the correct
channel!

On Mon, 25 Oct 2021, 11:15 pm 'Adam Johnson' via Django developers
(Contributions to Django itself), 
wrote:

> Hi!
>
> I think you've found the wrong mailing list for this post. This mailing
> list is for discussing the development of Django itself, not for support
> using Django. This means the discussions of bugs and features in Django
> itself, rather than in your code using it. People on this list are unlikely
> to answer your support query with their limited time and energy.
>
> For support, please follow the "Getting Help" page:
> https://docs.djangoproject.com/en/3.2/faq/help/ . This will help you find
> people who are willing to support you, and to ask your question in a way
> that makes it easy for them to answer.
>
> Thanks for your understanding and all the best,
>
> Adam
>
> On Mon, 25 Oct 2021 at 08:04, Amit Karnam  wrote:
>
>> Hello all,
>> I have created a Custom user model that takes email as the unique key
>> instead of the default Username.
>> Now I wanted to learn how to create a password reset for that. I have set
>> up the templates and the SendGrid account for that. Please guide me
>> regarding the next step.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/6fc45081-b452-4707-a6f6-dfe82d224548n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-developers/JjI_vblIKCU/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAMyDDM239raJnA89-6KgdjsNrsofqou5m2LUukUF81tDsSyrYA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAPyiDr20sA_EzVox2Bbom0M%3DdXDc-s7Dc6f6Tjp64OfOEMTkEg%40mail.gmail.com.


Default values for required and error css classes

2021-10-26 Thread smi...@gmail.com
 Hi all,

I was looking at the code for `forms.Form` recently and noticed that there 
are a couple of hooks[1] to add CSS classes to required or erroneous forms.

However, the ​`BaseForm` does not have a class level initialisation of 
these. The classes are then later added via a `hasattr` check.

I opened this as a ticket [2] and it was triaged as a duplicate of a ticket 
from 11 years ago [3]. At that time it was closed due to it not considered 
'worth setting' along with concerns about backward compatibility. Going 
back a bit further in time the proposed patch did include placeholders (as 
`None`) but for reasons I can't quite tell they we're not included in the 
merged version of the patch.

Significant time has passed since the decision was made and I'm interested 
in what _best practice_ is _these days_.

I think Carlton nicely summarised the spectrum here on one hand 
"auto-complete and type checkers much prefer attributes to be defined (as 
None?) rather than injected later" on the other there is a need to avoid 
"litter class definitions and/or init methods with None declaration (Better 
the tooling gets cleverer.)".

I've created a sample patch[5] and shown the extra help a modern IDE 
(Pycharm in this case) can provide if the variable is initalised as `None` 
at the class level. I also like that 
`hasattr(self.form, 'required_css_class')` can become `s
elf.form.required_css_class`. This change passes the test suite, so I'm 
unsure what the previous concerns about backwards compatibility are, likely 
I'm missing something.

So ultimatly I think the question is that if after all this time could we 
reopen ticket #14322 [3]

Appreciate thoughts on this, if only to help me understand API design 
better!

Kind Regards

David

1 
https://docs.djangoproject.com/en/3.2/ref/forms/api/#styling-required-or-erroneous-form-rows

2 https://code.djangoproject.com/ticket/33226

3 https://code.djangoproject.com/ticket/14322

4 https://code.djangoproject.com/ticket/3512#comment:30

5 https://gist.github.com/smithdc1/65605c52f05bd39bf43fed67962b7ece

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/680a9646-11fc-47c6-ac0d-200a0f9bdc54n%40googlegroups.com.