def image_field_data(request, include_empty_option=False):
 try:
  images = get_available_images(request, request.user.project_id)
 except Exception:
  exceptions.handle(request, _('Unable to retrieve images'))
 images.sort(key=(lambda c: c.name))
 images_list = [('', _('Select Image'))]
 for image in images:
  image_label = u'{} ({})'.format(image.name, filesizeformat(image.size))
  images_list.append((image.id, image_label))
 if (not images):
  return [('', _('No images available'))]
 return images_list

def image_field_data ( request , include_empty_option = False ) : try : images = get_available_images ( request , request . user . project_id ) except Exception : exceptions . handle ( request , _ ( 'Unable to retrieve images' ) ) images . sort ( key = ( lambda c : c . name ) ) images_list = [ ( '' , _ ( 'Select Image' ) ) ] for image in images : image_label = u'{} ({})' . format ( image . name , filesizeformat ( image . size ) ) images_list . append ( ( image . id , image_label ) ) if ( not images ) : return [ ( '' , _ ( 'No images available' ) ) ] return images_list
returns a list of tuples of all images .