def SortClassAdsByElement(classads, element_name):
    """
    Sort the classads (or any dictionary really) by an attribute
    
    @param classads: list of classad objects
    @param element_name: string of element name
    """
    sorted_ads = sorted(classads, key=lambda ad: int(ad[element_name]))
    return sorted_ads