before change Ticket Desc to TextArea
This commit is contained in:
1 parent
f7dbd02a6c
commit
ef18434b86
55 files changed
+1026
-59
No files matched your search
@@ -22,13 +22,24 @@ def list_product(workspace_uuid: str) -> ProductModel:
|
||||
|
||||
def list_product_by_category(workspace_uuid: str, category_id: int) -> ProductModel:
|
||||
try:
|
||||
product_category_obj = ProductModel.objects.filter(sys_ws__uuid=workspace_uuid, category_id=category_id)
|
||||
product_category_obj = ProductModel.objects.filter(sys_ws__uuid=workspace_uuid, category_id=category_id,
|
||||
view_only=False)
|
||||
return product_category_obj
|
||||
except Exception as exp:
|
||||
message = f'Error Fetching List Product by category: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def list_view_only_product_by_category(workspace_uuid: str, category_id: int) -> ProductModel:
|
||||
try:
|
||||
view_only_product_category_obj = ProductModel.objects.filter(sys_ws__uuid=workspace_uuid, category_id=category_id,
|
||||
view_only=True)
|
||||
return view_only_product_category_obj
|
||||
except Exception as exp:
|
||||
message = f'Error Fetching View Only List Product by category: {exp}'
|
||||
raise exceptions.ValidationError({'error': message})
|
||||
|
||||
|
||||
def count_product_in_category(workspace_uuid: str, category_id: int) -> int:
|
||||
try:
|
||||
count_product = ProductModel.objects.filter(sys_ws__uuid=workspace_uuid, category_id=category_id).count()
|
||||
|
||||
Reference in new issue
Block a user