#NEWLINE# def get_option( self , property_id ) : #NEWLINE# #INDENT# '\n        Returns the id of the selected option for property with passed id.\n        ' #NEWLINE# from lfs.caching.utils import get_cache_group_id #NEWLINE# pid = self . get_parent ( ) . pk #NEWLINE# properties_version = get_cache_group_id ( 'global-properties-version' ) #NEWLINE# group_id = ( '%s-%s' % ( properties_version , get_cache_group_id ( ( 'properties-%s' % pid ) ) ) ) #NEWLINE# cache_key = ( '%s-%s-productpropertyvalue%s' % ( settings . CACHE_MIDDLEWARE_KEY_PREFIX , group_id , self . id ) ) #NEWLINE# options = cache . get ( cache_key ) #NEWLINE# if ( options is None ) : #NEWLINE# #INDENT# options = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for pvo in self . property_values . all ( ) : #NEWLINE# #INDENT# options [ pvo . property_id ] = pvo . value #NEWLINE# #UNINDENT# cache . set ( cache_key , options ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return options [ property_id ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return None