'Get all trivial attributes from the object.
This function is used to extract attributes from a pb job. The
dictionary specifies the types of each attribute in each tko
class.
:param
obj: the pb object that is being extracted.
objdict: the dict that specifies the type.
:return: a dict of each attr name and it\'s corresponding value.'

def get_trivial_attr(self, obj, objdict):

    resultdict = {}
    for (field, field_type) in objdict.items():
        value = getattr(obj, field)
        if (field_type in (str, int, long)):
            resultdict[field] = field_type(value)
        elif (field_type == datetime):
            resultdict[field] = datetime.fromtimestamp((value / 1000.0))
    return resultdict
