def METHOD_NAME(self, direction='max'):
    ''' Query to get latest (default) or earliest update to repository '''
    from datetime import datetime
    if direction == 'min':
        return Resource.objects.aggregate(
            Min('last_updated'))['last_updated__min'].strftime('%Y-%m-%dT%H:%M:%SZ')
    return self._get_repo_filter(Resource.objects).aggregate(
        Max('last_updated'))['last_updated__max'].strftime('%Y-%m-%dT%H:%M:%SZ')