feat: attrs on product
This commit is contained in:
		
							
								
								
									
										11
									
								
								barcodes/attributes/composition_attribute_getter.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								barcodes/attributes/composition_attribute_getter.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
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
 | 
			
		||||
		Reference in New Issue
	
	Block a user