Re: User model (unique email)
Patrick Anderson napisaĆ(a): > I'd like to create a couple of views that would allow users to retrieve > their forgotten username or password by email. > > It seems to me that the only reliable way to do this would be for my > application to require unique email addresses for User objects. However > email field in django.contrib.auth.models.User is optional. > > I'd prefer not to hack the contrib.auth application and change User > model, so perhaps that constraint should be included in my application > code, but I'm not sure what the best way to do it should be. > > Any clues? As a last resort, you can monkeypatch your database and add unique constraint to the auth_user.email column. We did that and in our case this requires only one additional check when adding user. -- Jarek Zgoda Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101 "We read Knuth so you don't have to." (Tim Peters) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: User model (unique email)
On Tue, 31 Jul 2007 22:40:50 +, Pensee wrote: > Hi, > > On Jul 31, 11:46 pm, Patrick Anderson <[EMAIL PROTECTED]> wrote: >> I'd prefer not to hack the contrib.auth application and change User >> model, > > Adding just unique=true is not so hard and tracking with changes is easy > :). > > You may have a look at the "Django tips: extending the User model" on > The B List [1] > >> so perhaps that constraint should be included in my application code, >> but I'm not sure what the best way to do it should be. > > I think that's a bit of too much overhead. I mean you already have a > bunch of code that can handle this automaticaly. > > -- Amirouche > > > True, that is probably the least complicated method, but it requires me to remember this little hack. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: User model (unique email)
Hi, On Jul 31, 11:46 pm, Patrick Anderson <[EMAIL PROTECTED]> wrote: > I'd prefer not to hack the contrib.auth application and change User > model, Adding just unique=true is not so hard and tracking with changes is easy :). You may have a look at the "Django tips: extending the User model" on The B List [1] > so perhaps that constraint should be included in my application > code, but I'm not sure what the best way to do it should be. I think that's a bit of too much overhead. I mean you already have a bunch of code that can handle this automaticaly. -- Amirouche --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
User model (unique email)
I'd like to create a couple of views that would allow users to retrieve their forgotten username or password by email. It seems to me that the only reliable way to do this would be for my application to require unique email addresses for User objects. However email field in django.contrib.auth.models.User is optional. I'd prefer not to hack the contrib.auth application and change User model, so perhaps that constraint should be included in my application code, but I'm not sure what the best way to do it should be. Any clues? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---