sforkowany z mtyton/comfy
Merge pull request 'quick fix' (#6) from feature/product_sheet_load into main
Reviewed-on: mtyton/comfy#6main^2
commit
a294b3a5bb
|
@ -4,6 +4,7 @@ import requests
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from django.core.files.base import ContentFile
|
from django.core.files.base import ContentFile
|
||||||
|
from django.conf import settings
|
||||||
from store.models import (
|
from store.models import (
|
||||||
ProductTemplate,
|
ProductTemplate,
|
||||||
ProductCategoryParamValue,
|
ProductCategoryParamValue,
|
||||||
|
@ -42,8 +43,9 @@ class ProductLoader(BaseLoader):
|
||||||
def _get_images(self, row) -> list[ContentFile]:
|
def _get_images(self, row) -> list[ContentFile]:
|
||||||
url = row["images"]
|
url = row["images"]
|
||||||
images = []
|
images = []
|
||||||
response = requests.get(url+"/download", stream=True)
|
response = requests.get(
|
||||||
print(response.status_code)
|
url+"/preview", stream=True
|
||||||
|
)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
data = response.content
|
data = response.content
|
||||||
image = ContentFile(data, name=row["template"])
|
image = ContentFile(data, name=row["template"])
|
||||||
|
|
Ładowanie…
Reference in New Issue