'Returns the newest value for subject/attribute.'

@utils.Synchronized
def GetNewestValue(self, subject, attribute):

    subject = utils.SmartStr(subject)
    attribute = utils.SmartStr(attribute)
    query = 'SELECT    value,    timestamp    FROM    tbl\n                                                            WHERE    subject    =    ?    AND    predicate    =    ?\n                                                            ORDER    BY    timestamp    DESC\n                                                            LIMIT    1'
    args = (subject, attribute)
    data = self.Execute(query, args).fetchone()
    if data:
        return (data[0], data[1])
    else:
        return None
