feat: temp barcode templates
This commit is contained in:
		@@ -1,21 +1,24 @@
 | 
			
		||||
# from abc import abstractmethod, ABC
 | 
			
		||||
#
 | 
			
		||||
# from .article_attribute_writer import ArticleAttributeWriter
 | 
			
		||||
# from .name_attribute_writer import NameAttributeWriter
 | 
			
		||||
# from ..barcode import Barcode
 | 
			
		||||
#
 | 
			
		||||
#
 | 
			
		||||
# class BaseAttributeWriter(ABC):
 | 
			
		||||
#     @abstractmethod
 | 
			
		||||
#     def write(self, barcode: Barcode):
 | 
			
		||||
#         pass
 | 
			
		||||
#
 | 
			
		||||
#
 | 
			
		||||
# class AttributeWriterFactory:
 | 
			
		||||
#     @staticmethod
 | 
			
		||||
#     def get_writer(key: str):
 | 
			
		||||
#         match key:
 | 
			
		||||
#             case 'name':
 | 
			
		||||
#                 return NameAttributeWriter()
 | 
			
		||||
#             case 'article':
 | 
			
		||||
#                 return ArticleAttributeWriter()
 | 
			
		||||
from abc import abstractmethod, ABC
 | 
			
		||||
 | 
			
		||||
from models import Product
 | 
			
		||||
from .article_attribute_getter import ArticleAttributeGetter
 | 
			
		||||
from .client_name_attribute_getter import ClientNameAttributeGetter
 | 
			
		||||
from .name_attribute_getter import NameAttributeGetter
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class BaseAttributeGetter(ABC):
 | 
			
		||||
    @abstractmethod
 | 
			
		||||
    def get_value(self, product: Product):
 | 
			
		||||
        pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class AttributeWriterFactory:
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def get_writer(key: str):
 | 
			
		||||
        match key:
 | 
			
		||||
            case 'name':
 | 
			
		||||
                return NameAttributeGetter()
 | 
			
		||||
            case 'article':
 | 
			
		||||
                return ArticleAttributeGetter()
 | 
			
		||||
            case 'client.name':
 | 
			
		||||
                return ClientNameAttributeGetter()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user