Re: How to make email field unique in model User from contrib.auth in Django

2009-07-26 Thread ramusus
It's amazing for me, But I found a best solution! django-registration have form with checking unique email: RegistrationFormUniqueEmail http://bitbucket.org/ubernostrum/django-registration/issue/13/password-reset-issues-emails-should-be#comment-15422 On 26 июл, 15:09, ramusus wrote: > Thanks,

Re: How to make email field unique in model User from contrib.auth in Django

2009-07-26 Thread ramusus
Thanks, Andy and Parag! Validate email field via AJAX - very good idea. Could you describe case with pre-save signal in more detail, please! If I understand correctly, you are offering to use pre-save signal and raise ValidationError if email of new User exists in DB or smthing else? Could you

Re: How to make email field unique in model User from contrib.auth in Django

2009-07-21 Thread Parag Shah
Yes that is also a good idea. Validate the form with an AJAX call when the user enters the email addr (or clicks on Submit) -- Thanks & Regards Parag Shah http://blog.adaptivesoftware.biz On Wed, Jul 22, 2009 at 11:21 AM, Andy McKay wrote: > > Use a pre-save signal, but also validate your forms

Re: How to make email field unique in model User from contrib.auth in Django

2009-07-21 Thread Andy McKay
Use a pre-save signal, but also validate your forms correctly. On 21-Jul-09, at 12:33 PM, ramu...@gmail.com wrote: > Another idea may be to open a new ticket and upload a patch with new > parameter inside settings.py: > > AUTH_USER_EMAIL_UNIQUE = True You could do that, but if I had anything to

Re: How to make email field unique in model User from contrib.auth in Django

2009-07-21 Thread Parag Shah
One thought which comes to my mind is to have a pre-save signal when a User object is saved. Though I am not sure of this is the best way. -- Thanks & Regards Parag Shah On Wed, Jul 22, 2009 at 1:03 AM, ramu...@gmail.com wrote: > > I need to patch the standard User model of contrib.auth by ensur

How to make email field unique in model User from contrib.auth in Django

2009-07-21 Thread ramu...@gmail.com
I need to patch the standard User model of contrib.auth by ensuring the email field entry is unique: User._meta.fields[4].unique = True Where is best place in code to do that? I want to avoid using the number fields[4]. It's better to user fields ['email'], but fields is not dictionary, only li