Re: Nullable User email

2012-08-09 Thread Demian Brecht
Thanks for the feedback guys.. What I ended up doing was adding the following lines to my models module: from django.contrib.auth.models import User as BaseUser BaseUser._meta.get_field("username")._unique = False BaseUser._meta.get_field("email").null = True Melvin: I tried your suggestion and

Re: Nullable User email

2012-08-07 Thread Melvyn Sopacua
On 7-8-2012 17:08, Demian Brecht wrote: > 1. Copy/paste the entire model, changing the attribute of the one field. > 2. User._meta.fields[4].null = true 3. Override the __new__ method in your subclassed model and remove the email field definition from the class attributes to the meta class before

Re: Nullable User email

2012-08-07 Thread Demian Brecht
Thanks for the quote, was unaware of the convention. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/mxg72KZaS8EJ. To post to this group, send email to djan

Re: Nullable User email

2012-08-07 Thread Germán
It seems you shouldn't use null but rather an empty string: https://docs.djangoproject.com/en/dev/ref/models/fields/#null > Avoid using > null > on > string-based fields such as > CharField

Nullable User email

2012-08-07 Thread Demian Brecht
In an authentication backend I'm currently writing, I've supplied a custom User model that extends the contrib.auth User model. I have the need to allow email addresses to be NULL. A little context: I'm writing an OAuth2 wrapper for an OAuth2 client I relatively recently wrote (yes, I know that th