I have this style of e-mail usernames for my sites and where it might be not
as tight as possible, I have an implementation that works.

> 1) Make sure that emails are unique. According to the thread [1]
> there's no straight forward solution other than patching Django, and I
> hate patching Django. But maybe since that thread there's been new
> features allowing to do that without patch?
>
>
> http://groups.google.com/group/django-users/browse_thread/thread/8712e5bc0fc84483/12e9b40eee24bff1


In an environment that has users register on the site, django-registration
offers a form that checks for uniqueness of the email address. This works
well as it stops users from registering with duplicate email addresses. The
key next is to make sure no one who has access to add more users directly
doesn't add someone with the same e-mail address.

If this is important for you what I would recommend is pulling contrib.auth
out of the django package into your project and customize it. Contrib apps
are just that, apps. Just make sure all your settings.py paths point to the
new one. You can add a few lines of code to the add_view of auth straight
from django-registration to make sure e-mail is unique. Once you do that you
should have unique e-mails all around and you didn't need to touch the
django package, just use a chunk of code.

>
> <http://groups.google.com/group/django-users/browse_thread/thread/8712e5bc0fc84483/12e9b40eee24bff1>
>
> 2) Generate usernames automatically, since they're not really used
> anymore but can't stay blank. For example, automatically setting a new
> user name to "user_8371" if 8371 is the user id. How could I do that,
> since the User class is built in Django?


I extended a django-registration class to accomplish this. I just put it up
on djangosnippets.org. Check it out
http://www.djangosnippets.org/snippets/686/


Hope that helps,

Michael

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to