#NEWLINE# def __init__( self , model , auth_model = None , owner_field_name = 'owner' ) : #NEWLINE# #INDENT# super ( OwnershipPermissionPolicy , self ) . __init__ ( model , auth_model = auth_model ) #NEWLINE# self . owner_field_name = owner_field_name #NEWLINE# try : #NEWLINE# #INDENT# self . model . _meta . get_field ( self . owner_field_name ) #NEWLINE# #UNINDENT# except FieldDoesNotExist : #NEWLINE# #INDENT# raise ImproperlyConfigured ( ( "%s has no field named '%s'. To use this model with OwnershipPermissionPolicy, you must specify a valid field name as owner_field_name." % ( self . model , self . owner_field_name ) ) )