#NEWLINE# @ classmethod #NEWLINE# def _check_geo_field( cls , opts , lookup ) : #NEWLINE# #INDENT# "\n        Utility for checking the given lookup with the given model options.  \n        The lookup is a string either specifying the geographic field, e.g.\n        'point, 'the_geom', or a related lookup on a geographic field like\n        'address__point'.\n\n        If a GeometryField exists according to the given lookup on the model\n        options, it will be returned.  Otherwise returns None.\n        " #NEWLINE# field_list = lookup . split ( LOOKUP_SEP ) #NEWLINE# field_list . reverse ( ) #NEWLINE# fld_name = field_list . pop ( ) #NEWLINE# try : #NEWLINE# #INDENT# geo_fld = opts . get_field ( fld_name ) #NEWLINE# while len ( field_list ) : #NEWLINE# #INDENT# opts = geo_fld . rel . to . _meta #NEWLINE# geo_fld = opts . get_field ( field_list . pop ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# except ( FieldDoesNotExist , AttributeError ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if isinstance ( geo_fld , GeometryField ) : #NEWLINE# #INDENT# return cls #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return False