Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefilter option to context reference property #1468

1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ UNRELEASED
----------

* :star: We added the concept of signature property. With this property we handle signature's better and more explicit in KE-chain. Signatures are stored as StoredFiles. (#1467)
* :star: Add the possibility to add a prefilter option to the context reference property. It will be stored in the prefilter section of the value options of a the reference property.

v4.13.0 (15AUG24)
----------
Expand Down
34 changes: 34 additions & 0 deletions pykechain/models/property_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from pykechain.defaults import PARTS_BATCH_LIMIT
from pykechain.enums import (
ContextGroup,
ScopeReferenceColumns,
StoredFileCategory,
StoredFileClassification,
Expand All @@ -15,6 +16,7 @@
)
from pykechain.models.context import Context
from pykechain.models.form import Form
from pykechain.models.input_checks import check_enum
from pykechain.models.stored_file import StoredFile
from pykechain.models.value_filter import ScopeFilter
from pykechain.models.workflow import Status
Expand Down Expand Up @@ -226,6 +228,38 @@ class ContextReferencesProperty(_ReferencePropertyInScope):

REFERENCED_CLASS = Context

def set_prefilters(
jberends marked this conversation as resolved.
Show resolved Hide resolved
self,
prefilters: Optional = None,
clear: Optional[bool] = False,
context_group: Optional[ContextGroup] = None,
) -> None:
jberends marked this conversation as resolved.
Show resolved Hide resolved
"""
Set pre-filters on the Context reference property.

On the Context only a context_group prefilter can be set to a single ContextGroup.

:param prefilters: Not used
:param clear: whether all existing pre-filters should be cleared. (default = False)
:param context_group: An optional ContextGroup to prefilter on. One single prefilter is
allowed.

:return: None
"""
prefilters_dict = self._options.get("prefilters", dict())
if prefilters:
raise IllegalArgumentError(
"`prefilters` argument is unused. Use `context_group` instead."
)
if clear:
prefilters_dict = dict()
if context_group:
context_group = check_enum(context_group, ContextGroup, "context_group")
prefilters_dict = {"context_group": context_group}

if context_group or clear:
self._options.update({"prefilters": prefilters_dict})

jberends marked this conversation as resolved.
Show resolved Hide resolved
def _retrieve_objects(self, **kwargs) -> List[Context]:
"""
Retrieve a list of Contexts.
Expand Down
31 changes: 19 additions & 12 deletions pykechain/models/value_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
import warnings
from abc import abstractmethod
from typing import Any, Dict, List, Optional, Union
from urllib.parse import unquote

from pykechain.enums import Category, FilterType, PropertyType, ScopeStatus
from pykechain.enums import (
Category,
FilterType,
PropertyType,
ScopeStatus,
)
from pykechain.exceptions import IllegalArgumentError, NotFoundError
from pykechain.models.input_checks import (
check_base,
Expand Down Expand Up @@ -75,7 +81,7 @@ def __init__(

self.id = property_model_id
if isinstance(value, str):
self.value = urllib.parse.unquote(value)
self.value = unquote(value)
else:
self.value = value
self.type = filter_type
Expand Down Expand Up @@ -113,9 +119,7 @@ def validate(self, part_model: "Part") -> None:

if prop.category != Category.MODEL:
raise IllegalArgumentError(
'Property value filters can only be set on Property models, received "{}".'.format(
prop
)
f'Property value filters can only be set on Property models, received "{prop}".'
)
else:
property_type = prop.type
Expand Down Expand Up @@ -190,9 +194,10 @@ def validate(self, part_model: "Part") -> None:
@classmethod
def parse_options(cls, options: Dict) -> List["PropertyValueFilter"]:
"""
Convert the dict & string-based definition of a property value filter to a list of PropertyValueFilter objects.
Convert dict and string filters to PropertyValueFilter objects.

:param options: options dict from a multi-reference property or meta dict from a filtered grid widget.
:param options: options dict from a multi-reference property or meta dict from a filtered
grid widget.
:return: list of PropertyValueFilter objects
:rtype list
"""
Expand Down Expand Up @@ -235,7 +240,8 @@ class ScopeFilter(BaseFilter):
:ivar tag: string
"""

# map between KE-chain field and Pykechain attribute, and whether the filter is stored as a list (cs-string)
# map between KE-chain field and Pykechain attribute, and whether the filter is stored as a
# list (cs-string)
MAP = [
("name__icontains", "name", False),
("status__in", "status", False),
Expand Down Expand Up @@ -325,9 +331,10 @@ def __repr__(self):
@classmethod
def parse_options(cls, options: Dict) -> List["ScopeFilter"]:
"""
Convert the dict & string-based definition of a scope filter to a list of ScopeFilter objects.
Convert the dict & string-based definition of a scope filter to a list of ScopeFilter obj.

:param options: options dict from a scope reference property or meta dict from a scopes widget.
:param options: options dict from a scope reference property or meta dict from a scopes
widget.
:return: list of ScopeFilter objects
:rtype list
"""
Expand Down Expand Up @@ -377,8 +384,8 @@ def write_options(cls, filters: List) -> Dict:

if filter_value is not None:
if is_list:
# creata a string with commaseparted prefilters, the first item directly and
# consequent items with a ,
# create a string with comma separted prefilters, the first item directly
# and consequent items with a ,
# TODO: refactor to create a list and then join them with a ','
if field not in prefilters:
prefilters[field] = filter_value
Expand Down
1 change: 1 addition & 0 deletions pykechain/models/widgets/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ def _check_prefilters(
:raises IllegalArgumentError: when the type of the input is provided incorrect.
"""
if isinstance(prefilters, dict):
from pykechain.models import Property
property_models: List[Property, str] = prefilters.get(
MetaWidget.PROPERTY_MODELS, []
) # noqa
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.32.3"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.13.0"], "Authorization": ["Token <AUTH_TOKEN>"]}, "method": "GET", "uri": "<API_URL>/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit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roChWmZdlK07AWAmGpdCUwoHVhggIrelnoXJoZZYe749/ASxW3Ws+BwAA", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Mon, 16 Sep 2024 08:55:46 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "<API_URL>/api/v3/scopes.json?status=ACTIVE&name=Bike+Project&fields=id%2Cname%2Cref%2Ctext%2Ccreated_at%2Cupdated_at%2Cstart_date%2Cdue_date%2Cstatus%2Ccategory%2Cprogress%2Cmembers%2Cteam%2Ctags%2Cscope_options%2Cteam_id_name%2Cworkflow_root_id%2Ccatalog_root_id%2Capp_root_id%2Cproduct_model_id%2Cproduct_instance_id%2Ccatalog_model_id%2Ccatalog_instance_id%2Cproject_info&limit=2"}, "recorded_at": "2024-09-16T08:55:44"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.32.3"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.13.0"], "Authorization": ["Token <AUTH_TOKEN>"]}, "method": "GET", "uri": "<API_URL>/api/v3/parts.json?name=Wheel&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2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GuE8XzfLmfGZTDLW0RyC7mc7dxEqLVR8GmlC9Ps+Yur4BAW8HYW9WSR3DenBHfBOdxi9LoayF+t8+d1jGVx/SpiO/vuADjzsTMPefkdkkOBe8TbNBaBcLpsLLQnWJdJIVL6Lz3oTahiXKrPJF4hNQOB5ijHxiPevGmNLYIfjGeUZ9oxvS3eWQBSrfQ6oZjHNatWvk0AagPQVsBrAW9ZzacQx+5l1f/i+iBaRS8fOzL+5BpI32uAI5wtfy6sJ4Bt2hVMEpHt0sD7UC6Z+hQN7P6t/fwDDTJq2YANAAA=", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Mon, 16 Sep 2024 08:55:46 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "<API_URL>/api/v3/parts.json?name=Wheel&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-09-16T08:55:44"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.32.3"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.13.0"], "Authorization": ["Token <AUTH_TOKEN>"]}, "method": "GET", "uri": "<API_URL>/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA92ZWW8jNxKA/0ogYPdpaBVvUoARaGzNgfgY2JqMdxaBwKNo90aWtOpW4snA/31Lsg4ncWINZGANP6jVLF7F+opFlvS1lcazUdPq8FetEd7Qy2g2HL5qTab4SzWe1avyFOvZsKHiv7+2qtzqtFAFUDYYRt/AFKe3GFAxK0VIohjpM7ZozHCN1Pp19fO8NMVChXhXyFinaTVpqvGIhCRIocHL8fQLlY5PD3tHc9Ew1HVVKqq6a/bh7PTw40Gfqq5Jn2oyrFLVzHt87p2dDo67J/+a95oiDZUHgZbTEsA948CE6IPrgOkov8eNM1Z9pqazSX68qVs0rdN4goPF4mPWOWEILEiNTNkIzJekmbNacSgqaFOoxyRMcdTcdfHOKc+FYtwrz5QByTwGwbjyXsUgQECYr2qccbjoseJAk06bCu+ZnmYBjFBYMjExVQKwEEVh1gF4A1xqXTamf4thWq9tf7ks/cn4y4m+DJovk3m39yf9wY/do4+9bwYznmactjpAxh1Va4f6JQxnOBgvZqS1fL1dilb1jzITHLjSDzATwIDsKPpcdKTrSNjz2us7ZkRgaf8t/fXbIf+R2HjWTGakWTOd4e2rJTKeNGjnEpO2ZFIhJ0YOwRk5VxA+ofYpb5D1x00YfneF1eVVsybXzIVsLXwU4Juj0+6OCPlTI1S05u22ndBSgn9OCAtCkaAcExglUygd8zE65jhHGwJBtHGD8EOVmtl0E/Mm6/Kj4Lr9fvfg3XFv1w0onpqe017x7eh5oN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K3R0WkHZF/X8C/CI4Ck43TdTknVJFIQOnw7TIbFAhzxSRCaxKkbhFCsMmUDguBqJ2vJiYChfE8UVFYynghj4vaatKblKOItCVCZxyKWhNzJVQJcfiMhoRrUiZe1dUpC0rEzplJAdXCqDhLbqA3/2ms4Whf5ed/LXFVynUN/w3s8pkVinU7Z+SwdUsffAdxTtS7kkKRU4+9B/E/aayA3bPCK+ceA7J4E9/LN/+D4xfwmj1GwAA", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Mon, 16 Sep 2024 08:55:47 GMT"], "Content-Type": ["application/json"], "Transfer-Encoding": ["chunked"], "Connection": ["keep-alive"], "Vary": ["Accept-Encoding", "Accept, Accept-Language, Cookie"], "allow": ["GET, POST, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"], "Content-Encoding": ["gzip"]}, "status": {"code": 200, "message": "OK"}, "url": "<API_URL>/api/v3/parts.json?name=Bike&category=MODEL&limit=2&scope_id=bd5dceaa-a35e-47b0-9fc5-875410f4a56f&fields=id%2Cname%2Cref%2Cdescription%2Ccreated_at%2Cupdated_at%2Cproperties%2Ccategory%2Cclassification%2Cparent_id%2Cmultiplicity%2Cvalue_options%2Cproperty_type%2Cvalue%2Coutput%2Corder%2Cpart_id%2Cscope_id%2Cmodel_id%2Cproxy_source_id_name%2Cunit"}, "recorded_at": "2024-09-16T08:55:45"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"__Test context ref property @ 2024-09-16 10:55:45.033141\", \"part_id\": \"e4a047a6-4a00-41a6-bae4-732ac2f639de\", \"description\": \"Description of test ref property\", \"property_type\": \"CONTEXT_REFERENCES_VALUE\", \"value\": null, \"unit\": \"no unit\", \"value_options\": {}}"}, "headers": {"User-Agent": ["python-requests/2.32.3"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.13.0"], "Authorization": ["Token <AUTH_TOKEN>"], "Content-Length": ["270"], "Content-Type": ["application/json"]}, "method": "POST", "uri": "<API_URL>/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "response": {"body": {"encoding": "utf-8", "string": "{\"results\":[{\"id\":\"8399377c-c344-46b5-9e19-2ad7d78adf88\",\"name\":\"__Test context ref property @ 2024-09-16 10:55:45.033141\",\"ref\":\"test-context-ref-property-2024-09-16-105545033141\",\"description\":\"Description of test ref property\",\"property_type\":\"CONTEXT_REFERENCES_VALUE\",\"category\":\"MODEL\",\"order\":8,\"unit\":\"no unit\",\"value_options\":{},\"value\":[],\"created_at\":\"2024-09-16T08:55:47.250621Z\",\"updated_at\":\"2024-09-16T08:55:47.262915Z\",\"part_id\":\"e4a047a6-4a00-41a6-bae4-732ac2f639de\",\"scope_id\":\"bd5dceaa-a35e-47b0-9fc5-875410f4a56f\",\"model_id\":null,\"output\":true}]}"}, "headers": {"Server": ["nginx"], "Date": ["Mon, 16 Sep 2024 08:55:47 GMT"], "Content-Type": ["application/json"], "Content-Length": ["566"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["POST, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 201, "message": "Created"}, "url": "<API_URL>/api/v3/properties/create_model?fields=id%2Cname%2Cref%2Ccreated_at%2Cupdated_at%2Cmodel_id%2Cpart_id%2Corder%2Cscope_id%2Ccategory%2Cproperty_type%2Cvalue%2Cvalue_options%2Coutput%2Cdescription%2Cunit"}, "recorded_at": "2024-09-16T08:55:45"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["python-requests/2.32.3"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["*/*"], "Connection": ["keep-alive"], "X-Requested-With": ["XMLHttpRequest"], "PyKechain-Version": ["4.13.0"], "Authorization": ["Token <AUTH_TOKEN>"], "Content-Length": ["0"]}, "method": "DELETE", "uri": "<API_URL>/api/v3/properties/8399377c-c344-46b5-9e19-2ad7d78adf88.json"}, "response": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"Server": ["nginx"], "Date": ["Mon, 16 Sep 2024 08:55:48 GMT"], "Content-Type": ["application/json"], "Content-Length": ["14"], "Connection": ["keep-alive"], "vary": ["Accept, Accept-Language, Cookie"], "allow": ["GET, PUT, PATCH, DELETE, HEAD, OPTIONS"], "x-frame-options": ["SAMEORIGIN"], "content-language": ["en", "En"], "strict-transport-security": ["max-age=15768000; includeSubDomains"], "x-content-type-options": ["nosniff"], "referrer-policy": ["same-origin"], "cross-origin-opener-policy": ["same-origin"], "Ke-Chain": ["3"]}, "status": {"code": 204, "message": "No Content"}, "url": "<API_URL>/api/v3/properties/8399377c-c344-46b5-9e19-2ad7d78adf88.json"}, "recorded_at": "2024-09-16T08:55:46"}], "recorded_with": "betamax/0.9.0"}
Loading
Loading