12 lines
291 B
Python
12 lines
291 B
Python
from barcodes.attributes.base import BaseAttributeGetter
|
|
from models import Product
|
|
|
|
|
|
class CompositionAttributeGetter(BaseAttributeGetter):
|
|
|
|
def get_value(self, product: Product):
|
|
result = product.composition
|
|
if not result:
|
|
result = ''
|
|
return result
|