#NEWLINE# def get( self ) : #NEWLINE# #INDENT# 'Returns one or more radars.\n        \n        Parameters:\n        \n        count (optional): The number of results to return. Default is 100.\n        page (optional): The page of results. Default is 1.\n        id (optional): The radar identifier.\n        number (optional): The radar number.\n        user (optional): The email address of the radar submitter.\n        \n        Errors:\n        \n        400 Bad Request\n        ' #NEWLINE# result = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# count = self . request . get ( 'count' , None ) #NEWLINE# if count : #NEWLINE# #INDENT# count = int ( count ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# count = 100 #NEWLINE# #UNINDENT# page = self . request . get ( 'page' , None ) #NEWLINE# if page : #NEWLINE# #INDENT# page = int ( page ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# page = 1 #NEWLINE# #UNINDENT# parameters = [ ] #NEWLINE# radarId = self . request . get ( 'id' ) #NEWLINE# if radarId : #NEWLINE# #INDENT# parameters . append ( radarId ) #NEWLINE# radar = db . Radar ( ) . fetchById ( int ( radarId ) ) #NEWLINE# if radar : #NEWLINE# #INDENT# result = radar . toDictionary ( ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not result ) : #NEWLINE# #INDENT# radarNumber = self . request . get ( 'number' ) #NEWLINE# if radarNumber : #NEWLINE# #INDENT# parameters . append ( radarNumber ) #NEWLINE# radar = db . Radar ( ) . fetchByNumber ( radarNumber ) #NEWLINE# if radar : #NEWLINE# #INDENT# result = radar . toDictionary ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not result ) : #NEWLINE# #INDENT# userName = self . request . get ( 'user' ) #NEWLINE# if userName : #NEWLINE# #INDENT# parameters . append ( userName ) #NEWLINE# user = google . appengine . api . users . User ( userName ) #NEWLINE# if user : #NEWLINE# #INDENT# radars = db . Radar ( ) . fetchByUser ( user , page , count ) #NEWLINE# if radars : #NEWLINE# #INDENT# result = [ radar . toDictionary ( ) for radar in radars ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( not result ) and ( not parameters ) ) : #NEWLINE# #INDENT# radars = db . Radar ( ) . fetchAll ( page , count ) #NEWLINE# if radars : #NEWLINE# #INDENT# result = [ radar . toDictionary ( ) for radar in radars ] #NEWLINE# #UNINDENT# #UNINDENT# self . respondWithDictionaryAsJSON ( { #NEWLINE# #INDENT# 'result' : result , #NEWLINE# #UNINDENT# } )