Allow product field renderer to suppress hyperlink
This commit is contained in:
parent
b160ac64eb
commit
09ffdba9ef
|
@ -26,6 +26,8 @@ Product Field Renderers
|
||||||
|
|
||||||
from __future__ import unicode_literals, absolute_import
|
from __future__ import unicode_literals, absolute_import
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
from rattail.gpc import GPC
|
from rattail.gpc import GPC
|
||||||
from rattail.db import model
|
from rattail.db import model
|
||||||
from rattail.db.util import maxlen
|
from rattail.db.util import maxlen
|
||||||
|
@ -57,7 +59,9 @@ class ProductFieldRenderer(AutocompleteFieldRenderer):
|
||||||
product = self.raw_value
|
product = self.raw_value
|
||||||
if not product:
|
if not product:
|
||||||
return ''
|
return ''
|
||||||
return tags.link_to(product, self.request.route_url('products.view', uuid=product.uuid))
|
if kwargs.get('hyperlink', True):
|
||||||
|
return tags.link_to(product, self.request.route_url('products.view', uuid=product.uuid))
|
||||||
|
return six.text_type(product)
|
||||||
|
|
||||||
|
|
||||||
class ProductKeyFieldRenderer(TextFieldRenderer):
|
class ProductKeyFieldRenderer(TextFieldRenderer):
|
||||||
|
|
Loading…
Reference in a new issue