3

\                 @   sL   d dl mZ d dlmZ d dlmZ d dlmZ dd Zdd Z	d	d
 Z
dS )    )import_module)
exceptions)reverse)
Applicatorc             C   s   dt dd| jid| jf S )Nz<a href="%s">%s</a>zdashboard:range-updatepk)kwargs)r   r   name)range r
   1/var/www/html/oscar2019/oscar/apps/offer/utils.pyrange_anchor	   s    r   c             C   s   |j S )z
    Return the relevant price for a given basket line.

    This is required so offers can apply in circumstances where tax isn't known
    )unit_effective_price)offerliner
   r
   r   
unit_price   s    r   c             C   s   | j dd\}}yt|}W n4 tk
rP } ztjd||f W Y d d }~X nX y
t||S  tk
r   tjd||f Y nX d S )N.   zError importing module %s: %szModule %s does not define a %s)rsplitr   ImportErrorr   ImproperlyConfiguredgetattrAttributeError)proxy_classmodule	classnamemoder
   r
   r   
load_proxy   s     
r   N)	importlibr   django.corer   django.urlsr   Zoscar.apps.offer.applicatorr   r   r   r   r
   r
   r
   r   <module>   s   	