Sunday, July 31, 2011

Django User (auth) question

Hello,

I have a question about tweaking the django.contrib.auth.models.User class. I noticed that Django doesn't allow for overriding of attributes of "Field" instances, such as "email" or "first name". Yet, I'd like to my email and first name fields to be required and I'd also like to have my email Field be unique. What is the recommended way to achieve this? 

It's also a little odd that in Postgres, the first_name column (and others) are defined as "not null", but the User model in Django does not mark those fields as required. Does that mean it puts an empty string into that column instead of using a null? That seems a little strange in itself, but not that big a deal.

Basically, I'm trying to figure out how to slightly customize the Django auth User class to be fit to my needs a little bit more, and I can't seem to figure it out from the documentation.

Thanks!

-JamesD

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

No comments:

Post a Comment