Without changing or subclassing the User model (which shouldn't be done, 
because it causes problems), I don't know how you can put the unique e-mail 
address constraint on the database, except manually via your database's own 
tool. I don't know if that can cause problems with Django's ORM, and it is 
probably a very complicated question with answers that differ greatly depending 
on the database backend and driver being used. So I can't offer any useful info 
here.

However, on the front end you can certainly override the clean() methods of 
your fields, and gracefully handle checking of duplicates and user-friendly 
error messages. I know you like the DB constraints because it's a 
best-practice, but if no other software will be accessing your database then 
this is all you'll need. 

For your two questions:

You don't need to remove the username from the ModelForm -- just don't include 
it in the template. 
    Override the default template (copy the default template and modify your 
changed version).

To change the label on the template, you can change the 'label' property of the 
field in your subclassed ModelForm.
    Something like this (in the __init__, after calling the __init__ of super():
        
        self.fields['username'].label = 'E-mail Address'


Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to