Skip to content

A beautiful content wrapper for SENAITE that you will love

License

Notifications You must be signed in to change notification settings

senaite/senaite.app.supermodel

Repository files navigation

senaite.app.supermodel

A beautiful content wrapper for SENAITE that you will love

About

The SENAITE.APP.SUPERMODEL is a content wrapper for objects and catalog brains in SENAITE and provides a unified dictionary interface to access the schema fields, methods and metadata.

For what is it needed?

The purpose of the SUPERMODEL is to help coders to access the data from content objects. It also ensures that the most effective and efficient method is used to achieve a task.

How does it work?

A SuperModel can be instantiated with an UID of a content object:

>>> from senaite.app.supermodel import SuperModel
>>> supermodel = SuperModel('e37c1b659137414e872c08af410f09b4')

This will give transparent access to all schema fields of the wrapped object as well to all the metadata columns of the primary catalog of this object:

>>> supermodel.MySchemaField'
'Value of MySchemaField'

Please read the full functional doctest to see the super powers of the SuperModel in action.

Installation

SENAITE.APP.SUPERMODEL is a dependency of SENAITE.CORE and therefore no additional installation steps are required.

License

SENAITE.APP.SUPERMODEL Copyright (C) RIDING BYTES & NARALABS

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.