Skip to content

Module arches_orm.wrapper

Variables

logger

Classes

ResourceWrapper

class ResourceWrapper(
    view_model,
    id=None,
    _new_id=None,
    resource=None,
    cross_record=None,
    related_prefetch=None,
    **kwargs
)

Superclass of all well-known resources.

When you use, Person, etc. it will be this class in disguise.

Ancestors (in MRO)

  • abc.ABC

Descendants

  • arches_orm.static.wrapper.StaticResourceWrapper

Class variables

proxy

Static methods

all

def all(
    related_prefetch=None
)

Get all resources of this type.

all_ids

def all_ids(
    
)

Get IDs for all resources of this type.

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
)

find

def find(
    resourceinstanceid
)

Find an individual well-known resource by instance ID.

get_adapter

def get_adapter(
    
)

Get the adapter that encapsulates this wrapper.

def search(
    text,
    fields=None,
    _total=None
)

Search for resources of this model, and return as well-known resources.

to_repr_cls

def to_repr_cls(
    
)

Convert to string.

where

def where(
    cross_record=None,
    **kwargs
)

Do a filtered query returning a list of well-known resources.

Instance variables

resourceinstanceid

Methods

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.

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.

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.