def query(self, session): query = (session.query(User.id.label('id'), User.uuid.label('uuid'), UserLine.line_id.label('line_id'), User.agentid.label('agent_id'), User.firstname.label('firstname'), func.nullif(User.lastname, '').label('lastname'), func.nullif(User.email, '').label('email'), func.nullif(User.mobilephonenumber, '').label('mobile_phone_number'), Voicemail.mailbox.label('voicemail_number'), func.nullif(User.userfield, '').label('userfield'), func.nullif(User.description, '').label('description'), Extension.exten.label('exten'), Extension.context.label('context'))) return query
def unconditional_destination(cls): return func.nullif(cls.destunc, '')
def noanswer_destination(cls): return func.nullif(cls.destrna, '')
def faeding_leit(self): return func.nullif(cast(func.right(self.faeding, 4), Numeric(4, 0)), 0)
def description(cls): return func.nullif(cls.webi_description, '')
def userfield(cls): return func.nullif(cls.webi_userfield, '')
def music_on_hold(cls): return func.nullif(cls.musiconhold, '')
def caller_id(cls): return func.nullif(cls.callerid, '')
def music_on_hold(cls): return func.nullif(cls.musiconhold, '')
def outgoing_caller_id(cls): return func.nullif(cls.outcallerid, '')
def caller_id(cls): return func.nullif(cls.callerid, '')
def password(cls): return func.nullif(cls.passwdclient, '')
def username(cls): return func.nullif(cls.loginclient, '')
def interface_suffix(cls): return func.nullif(cls.intfsuffix, '')
def username(cls): return func.nullif(cls.loginclient, '')
def password(cls): return func.nullif(cls.passwdclient, '')
def mobile_phone_number(cls): return func.nullif(cls.mobilephonenumber, '')
def outgoing_caller_id(cls): return func.nullif(cls.outcallerid, '')
def userfield(cls): return func.nullif(cls.webi_userfield, '')
def mobile_phone_number(cls): return func.nullif(cls.mobilephonenumber, '')
def lastname(cls): return func.nullif(cls.webi_lastname, '')
def lastname(cls): return func.nullif(cls.webi_lastname, '')
def description(cls): return func.nullif(cls.webi_description, '')
def provisioning_code(cls): return cast(func.nullif(cls.provisioningid, 0), String)
def busy_destination(cls): return func.nullif(cls.destbusy, '')