librelist archives

« back to archive

user模型字段

user模型字段

From:
Uno Young
Date:
2012-07-10 @ 10:42
 __fields = {

--基本信息
['username'] = { required=true, unique=true },
['email'] = { unique=true }, --邮箱
['tel'] = { unique=true },

['password'] = { required=true, default='' },
['salt'] = {},

--详细信息
['gender'] = {},
['nickname'] = {},
['realname'] = {},--真实名称
['identity_card'] = {},
['birthday'] = {},
['astro'] = { enum={[1]='白羊座'}, type='number' }, --星座
['blood_type'] = { enum={'A', 'B', 'O', 'AB', '其他'}},--血型
['hometown'] = {},
['location'] ={},--现居地
['nation'] = {},--民族
['slogan'] = {}, --个性签名
['qq'] = {},
['occupation'] = {}, --职业
['notes'] = {}, --备注

--统计信息
['score'] = {}, --积分
['level'] = {type='number'}, --等级
['medal'] = {}, --勋章

 --头像
['avatar'] = {},
-- 正常头像: media/uploads/user/1/xxx.jpg
-- 中等头像: media/uploads/user/1/xxx_thumb.jpg    150*150
-- 迷你头像: media/uploads/user/1/xxx_mini.jpg     50*50

--教育情况
['is_student'] = { type='boolean' }, --是否在校
['degree'] = {}, --学历
['major'] = {}, --专业
--['enroll_date'] = {}, --入学时间
 --用户状态
['is_online'] = {type='boolean'}, --是否在线

--权限组
['groups'] = {foreign='Permission', st='MANY'},
}