#780: patch attempt (non functional) at making identity more adaptable --------------------------------+------------------------------------------- Reporter: [EMAIL PROTECTED] | Owner: anonymous Type: enhancement | Status: new Priority: normal | Milestone: Component: Identity | Version: 0.9a4 Severity: normal | Keywords: --------------------------------+------------------------------------------- The current Identity schema requires both a user_name and a user_email.
I dislike that, because while on some projects I want users to have both, on many I want the user to have one or the other. Someone submitted a patch earlier that makes email not-required , which is great for their application, but doesn't work for mine - it still requires a unique user submitted id name. my attached patch doesn't work - I couldnt get things quite right, but it presents a different approach that hopefully someone else can take over or help me complete let me just elaborate on the idea a_ app.cfg the setting for identity.form.user_name is changed to 'account_identifier', which can either be 'user_name' or 'user_email' we add a 'identity.account_identifier' setting that can either be 'user_name' or 'user_email' . this represents the primary unique idfield. we add 'required.user_email' and 'required.user_name' boolean options - should these fields be required? b_ visitor.py references to user_name are replaced with account_identifier c_ so/sa providor essentially, _get_user_name becomes _get_account_identifier i tried to make things backwards compatible (perhaps too much) , so 'user_name' is still stored in some places (as is user_email'), but only in addition to account_identifier i upped user_name from 16 to 255 characters. user_email and display_name are both 255. I hope at least this idea is accepted - it would at least give people the chance to put an email address in user_name (although that would be really confusing) i wasn't sure if this would work or not, but if possible, i think we should set alternateId, alternateIdMethod in TG user based on the settings in app.cfg hopefully, an approach like this will accomplish the following: a- have no impact on people already using identity b- let people use user_name as the primary id (and omit user_email) c- let people use user_email as the primary id (and omit user_name) d- let people use both user_name and user_email -- Ticket URL: <http://trac.turbogears.org/turbogears/ticket/780> TurboGears <http://www.turbogears.org/> TurboGears front-to-back web development --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Tickets" group. To post to this group, send email to turbogears-tickets@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-tickets -~----------~----~----~----~------~----~------~--~---