As if there hasn't been enough heat and light over the issue, here's my $0.02:

1. First principles: the absolute minimum a user table needs is a
unique string to identify a user. Theoretically, the user table's PK
suffices, but that's probably not enough to let a user log in, so
we'll need some string-based representation.

2. The vast majority of TG-based apps using identity will also want a
"password" field. That's not the case for password-less apps, or apps
that want to get their auth/auth credentials from an external source,
but that's probably a safe minority.

3. The majority (but not as many as #2) will probably want a
"displayable" string that's more friendly than #1.  It's a slim enough
majority that we probably can't assume it, though.

4. It seems to me that most public-facing apps that require an email
address will use it as the uniquely-identifying string, so that should
be large enough to hold an email address, and should be named in a
content-neutral way (like the current "userId" name, or its
PEP-8-compliant equivalent).

5. Whether or not the app *needs* a "created" timestamp, if one exists
and it is properly set by default, it doesn't impose any hardship to
have it.

That leaves us with this as the "reasonably-minimal" TG_User table:

class TG_User(InheritableSQLObject):
    class sqlmeta:
        table="tg_user"

    user_id= UnicodeCol( length=255, alternateID=True, notNone=True,
title="User ID" )
    display_name = UnicodeCol(length=255, default=None, title='Display Name')
    password= UnicodeCol( length=40, title='Password')
    created= DateTimeCol( default=datetime.now, title='Date Created')

    def _get_display_name(self):
        '''If the app doesn't use a separate displayable name, use the
user id.'''
        return self._SO_get_display_name() or self.user_id

    [additional magic attributes same as current TG_User)

Would this be a reasonable default?
--
Tim Lesher <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to