On Apr 6, 9:04 pm, Julien <[EMAIL PROTECTED]> wrote:
> In fact, I'd prefer to leave what comes with Django, including contrib
> apps, untouched. So that I can benefit from bug fixing and
> implementation of new features done by the community.
>
> How about hijacking the User EmailField definition with Python
> setattr? Would that be possible/safe and how?
I think that's pretty iffy.
What we did is in our app which implements the userprofile, we added
custom sql to make the username column longer, and to make the email
column unique:
ALTER TABLE `auth_user` MODIFY `username` varchar(75) NOT NULL UNIQUE;
ALTER TABLE `auth_user` MODIFY `email` varchar(75) NOT NULL UNIQUE;
Then, creating the username was easy in our case, b/c the signup is a
custom REST method. What it does is that if a username was entered,
then it's all good (an error will get thrown if the username is a
dupe). If not, it uses the email address as the username before saving
the new User object. It does mean that i could create an account with
your email as my username, which will annoy you when you try to
register, but that can be avoided by disallowing the '@' character in
the username when it's provided.
In your case, you could simply copy and refact the form itself, not
the entire app, and implement that logic in there.... i think if your
templates dir is before the app's template dir, django would pick up
your copy, wouldn't it??? Otherwise you could also just hijack the
signup view to use your form, but then use contrib.auth for everything
else.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---