3

\%                 @   sL   d dl mZ d dlmZmZ G dd dejZG dd dejejej	Z
dS )    )strategy)get_currencyget_selected_countryc               @   s   e Zd ZdddZdS )SelectorNc             K   s   t |S )z:
        Return an instantiated strategy instance
        )CountryStrategy)selfrequestuserkwargs r   0/var/www/html/oscar2019/apps/partner/strategy.pyr      s    zSelector.strategy)NN)__name__
__module____qualname__r   r   r   r   r   r      s   r   c               @   s   e Zd Zdd ZdddZdS )r   c             C   s>   y$t | j}t|}|jj|dj S  tk
r8   d S X d S )N)price_currency)r   r   r   stockrecordsfilterfirst
IndexError)r   productcountrycurrencyr   r   r   select_stockrecord   s    
z"CountryStrategy.select_stockrecordNc             C   s   | j |j|S )N)fetch_for_productr   )r   linestockrecordr   r   r   fetch_for_line   s    zCountryStrategy.fetch_for_line)N)r   r   r   r   r   r   r   r   r   r      s   r   N)oscar.apps.partnerr   baseZapps.customer.utilsr   r   r   StockRequiredNoTax
Structuredr   r   r   r   r   <module>   s   