Show More
@@ -270,7 +270,7 b' class User(Base, BaseModel):' | |||||
270 | admin = Column("admin", Boolean(), nullable=True, unique=None, default=False) |
|
270 | admin = Column("admin", Boolean(), nullable=True, unique=None, default=False) | |
271 | name = Column("name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
271 | name = Column("name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
272 | lastname = Column("lastname", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
272 | lastname = Column("lastname", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
273 | email = Column("email", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
273 | _email = Column("email", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
274 | last_login = Column("last_login", DateTime(timezone=False), nullable=True, unique=None, default=None) |
|
274 | last_login = Column("last_login", DateTime(timezone=False), nullable=True, unique=None, default=None) | |
275 | ldap_dn = Column("ldap_dn", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
275 | ldap_dn = Column("ldap_dn", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
276 | api_key = Column("api_key", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
276 | api_key = Column("api_key", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
@@ -284,6 +284,18 b' class User(Base, BaseModel):' | |||||
284 |
|
284 | |||
285 | group_member = relationship('UsersGroupMember', cascade='all') |
|
285 | group_member = relationship('UsersGroupMember', cascade='all') | |
286 |
|
286 | |||
|
287 | @hybrid_property | |||
|
288 | def email(self): | |||
|
289 | return self._email | |||
|
290 | ||||
|
291 | @email.setter | |||
|
292 | def email(self, val): | |||
|
293 | self._email = val.lower() if val else None | |||
|
294 | ||||
|
295 | @property | |||
|
296 | def full_name(self): | |||
|
297 | return '%s %s' % (self.name, self.lastname) | |||
|
298 | ||||
287 | @property |
|
299 | @property | |
288 | def full_contact(self): |
|
300 | def full_contact(self): | |
289 | return '%s %s <%s>' % (self.name, self.lastname, self.email) |
|
301 | return '%s %s <%s>' % (self.name, self.lastname, self.email) |
General Comments 0
You need to be logged in to leave comments.
Login now