Module arches_orm.static.wrapper
Variables
logger
Classes
StaticResourceWrapper
class StaticResourceWrapper(
view_model,
id=None,
_new_id=None,
resource=None,
cross_record=None,
related_prefetch=None,
**kwargs
)
Static wrapper for all well-known resources.
When you use, Person
, etc. it will be this class in disguise.
Ancestors (in MRO)
- arches_orm.wrapper.ResourceWrapper
- abc.ABC
Class variables
proxy
Static methods
build
def build(
**kwargs
)
Create a new well-known resource.
Makes a well-known resource but not (yet) Arches resource, from field values.
create
def create(
_no_save=False,
_do_index=True,
**kwargs
)
Create a new well-known resource and Arches resource from field values.
create_bulk
def create_bulk(
fields: 'list',
do_index: 'bool' = True
)
to_repr_cls
def to_repr_cls(
)
Convert to string.
Instance variables
resourceinstanceid
Methods
all
def all(
cls,
related_prefetch=None
) -> list['StaticResourceWrapper']
Get all resources of this type.
all_ids
def all_ids(
cls
) -> list[str]
Get IDs for all resources of this type.
append
def append(
self,
_no_save=False
)
When called via a relationship (dot), append to the relationship.
delete
def delete(
self
)
Delete the underlying resource.
describe
def describe(
self
)
Give a textual description of this well-known resource.
find
def find(
cls,
resourceinstanceid
)
Find an individual well-known resource by instance ID.
get_adapter
def get_adapter(
)
Get the adapter that encapsulates this wrapper.
get_orm_attribute
def get_orm_attribute(
self,
key
)
Retrieve Python values for nodes attributes.
get_root
def get_root(
self
)
Get the root value.
index
def index(
self
)
Index the underlying resource.
reload
def reload(
self,
ignore_prefetch=True
)
Reload field values, but not node values for class.
remove
def remove(
self
)
When called via a relationship (dot), remove the relationship.
save
def save(
self
)
Rebuild and save the underlying resource.
search
def search(
cls,
text,
fields=None,
_total=None
) -> tuple[list[int], int]
Search for resources of this model, and return as well-known resources.
set_orm_attribute
def set_orm_attribute(
self,
key,
value
)
Set Python values for nodes attributes.
to_repr
def to_repr(
self
)
Convert to string.
to_string
def to_string(
self
)
Convert to string.
update
def update(
self,
values: 'dict'
)
Apply a dictionary of updates to fields.
where
def where(
cls,
cross_record=None,
**kwargs
)
Do a filtered query returning a list of well-known resources.