|
|
|
|
@ -1,6 +1,27 @@ |
|
|
|
|
from django.utils.html_parser import HTMLParser |
|
|
|
|
|
|
|
|
|
from .models import Product |
|
|
|
|
|
|
|
|
|
#@TODO: MAKE DESCTIPTION PREVIEW |
|
|
|
|
class ProductDesctipionHtmlParser(HTMLParser): |
|
|
|
|
|
|
|
|
|
def __init__(self, convert_charrefs=False, **kwargs): |
|
|
|
|
super().__init__(convert_charrefs, **kwargs) |
|
|
|
|
|
|
|
|
|
def error(self, message): |
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
def handle_startendtag(self, tag, attrs): |
|
|
|
|
super().handle_startendtag(tag, attrs) |
|
|
|
|
|
|
|
|
|
def handle_data(self, data): |
|
|
|
|
super().handle_data(data) |
|
|
|
|
|
|
|
|
|
def handle_endtag(self, tag): |
|
|
|
|
super().handle_endtag(tag) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#@TODO: NOT USED. FIGURE OUT THE PUPRPOSE OF THIS CODE |
|
|
|
|
def get_variant_picker_data(product): |
|
|
|
|
variants = product.variants.all() |
|
|
|
|
variant_attributes = product.attributes.all() |
|
|
|
|
|