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, Andy and Parag!
>
> Validateemailfield 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 ifemailof new User exists in DB or smthing
> else?
>
> Could you demonstrate example of this handler of pre-save signal?
>
> On 22 июл, 09:54, Parag Shah  wrote:
>
> > Yes that is also a good idea. Validate the form with an AJAX call when the
> > user enters theemailaddr (or clicks on Submit)
>
> > --
> > Thanks & Regards
> > Parag Shahhttp://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 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 do with it, it would be
> > > rejected, so don't bother :)
> > > --
> > >   Andy McKay
> > >   Clearwind Consulting:www.clearwind.ca
> > >   Blog:www.agmweb.ca/blog/andy
> > >   Twitter: twitter.com/clearwind
>
>
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 demonstrate example of this handler of pre-save signal?

On 22 июл, 09:54, Parag Shah  wrote:
> 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 Shahhttp://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 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 do with it, it would be
> > rejected, so don't bother :)
> > --
> >   Andy McKay
> >   Clearwind Consulting:www.clearwind.ca
> >   Blog:www.agmweb.ca/blog/andy
> >   Twitter: twitter.com/clearwind
>
>
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 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 do with it, it would be
> rejected, so don't bother :)
> --
>   Andy McKay
>   Clearwind Consulting: www.clearwind.ca
>   Blog: www.agmweb.ca/blog/andy
>   Twitter: twitter.com/clearwind
>
>
> >
>

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 do with it, it would be  
rejected, so don't bother :)
--
   Andy McKay
   Clearwind Consulting: www.clearwind.ca
   Blog: www.agmweb.ca/blog/andy
   Twitter: twitter.com/clearwind


--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 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 list.
>
> Another idea may be to open a new ticket and upload a patch with new
> parameter inside settings.py:
>
> AUTH_USER_EMAIL_UNIQUE = True
>
> Any suggestions on the most correct way to achieve email address
> uniqueness in the Django User model?
>
> Copy from here:
>
> http://stackoverflow.com/questions/1160030/how-to-make-email-field-unique-in-model-user-from-contrib-auth-in-django
> >
>

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



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 list.

Another idea may be to open a new ticket and upload a patch with new
parameter inside settings.py:

AUTH_USER_EMAIL_UNIQUE = True

Any suggestions on the most correct way to achieve email address
uniqueness in the Django User model?

Copy from here:
http://stackoverflow.com/questions/1160030/how-to-make-email-field-unique-in-model-user-from-contrib-auth-in-django
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---