> user_id links to users.id
> but extended table has only rows corresponding to users who have entered
> info1, info2 info3
>
> any thoughts on the best practises on how to manage extended user info
> thanks a lot
you can use sql to define the type of joins you wish to set between
the tables.
for instance, if you define your query like:
select ...
FROM UsersTable Left Join UsersExtendedTable On UsersTable.UID =
UsersExtendedTable.UID
WHERE ...
you will end up with a result set that will contain all the data
available for that user.
I will setup a user class like the one listed below and be able to
perform:
u = User()
>>> u.propertyA = "FOO"
>>> del u.propertyB
>>>if extended_property in u:
>>> print 'this user has the extended_property'
class User(object):
data = None
def __init__(self, uid):
data = web.select("myExtenedUsersView", where = "uid=$uid",
vars =
locals())
def __getattr__(self, key):
try:
return self.data[key]
except KeyError, k:
raise AttributeError, k
def __setattr__(self, key, value):
self.data[key] = value
def __delattr__(self, key):
try:
del self.data[key]
except KeyError, k:
raise AttributeError, k
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---