guillotina.content

class guillotina.content.Resource(id=None)

Base resource object class

property acl: dict

Access control list stores security information on the object

add_behavior(iface)

We need to apply the marker interface.

value: Interface to add

Return type:

None

remove_behavior(iface)

We need to apply the marker interface.

value: Interface to add

Return type:

None

property uuid

The unique id of the content object

class guillotina.content.Item(id=None)

Basic item content type. Inherits from Resource

class guillotina.content.Folder(id=None)

Basic folder content type. Inherits from Resource but provides interface to work with contained objects asynchronously.

async async_contains(key)

Asynchronously check if key exists inside this folder

Parameters:

key (str) -- key of child object to check

Return type:

bool

async async_del(key)

Asynchronously delete object in the folder

Parameters:

key (str) -- key of child objec to delete

Return type:

None

async async_get(key, default=None, suppress_events=False)

Asynchronously get an object inside this folder

Parameters:

key (str) -- key of child object to get

Return type:

Optional[InterfaceClass]

async async_items(suppress_events=False)

Asynchronously iterate through contents of folder

Return type:

AsyncIterator[Tuple[str, Resource]]

async async_keys()

Asynchronously get the sub object keys in this folder

Return type:

List[str]

async async_len()

Asynchronously calculate the len of the folder

Return type:

int

async async_multi_get(keys, default=None, suppress_events=False)

Asynchronously get an multiple objects inside this folder

Parameters:

keys (List[str]) -- keys of child objects to get

Return type:

AsyncIterator[InterfaceClass]

async async_set(key, value)

Asynchronously set an object in this folder

Parameters:
  • key (str) -- key of child object to set

  • value (Resource) -- object to set as child

Return type:

None

class guillotina.content.Container(id=None)
async guillotina.content.create_content_in_container(parent, type_, id_, request=None, check_security=True, check_constraints=True, **kw)

Utility to create a content.

This method is the one to use to create content. id_ can be None

Parameters:
  • parent (Folder) -- where to create content inside of

  • type -- content type to create

  • id -- id to give content in parent object

  • request (Optional[InterfaceClass]) -- <optional>

  • check_security (bool) -- be able to disable security checks

Return type:

Resource

guillotina.content.get_all_possible_schemas_for_type(type_name)
Return type:

List[InterfaceClass]

guillotina.content.iter_schemata(obj)
Return type:

Iterator[InterfaceClass]

async guillotina.content.move(context, destination=None, new_id=None, check_permission=True)
Return type:

None

async guillotina.content.duplicate(context, destination=None, new_id=None, check_permission=True, reset_acl=False)
Return type:

InterfaceClass