def image_member_count(context, image_id):
 session = get_session()
 if (not image_id):
  msg = _('Image id is required.')
  raise exception.Invalid(msg)
 query = session.query(models.ImageMember)
 query = query.filter_by(deleted=False)
 query = query.filter((models.ImageMember.image_id == str(image_id)))
 return query.count()

def image_member_count ( context , image_id ) : session = get_session ( ) if ( not image_id ) : msg = _ ( 'Image id is required.' ) raise exception . Invalid ( msg ) query = session . query ( models . ImageMember ) query = query . filter_by ( deleted = False ) query = query . filter ( ( models . ImageMember . image_id == str ( image_id ) ) ) return query . count ( )
return the number of image members for this image .