pycram.orm.views

Module Contents

Classes

CreateView

Class that is used to create a view. Every instance will be compiled into a SQL CREATE VIEW statement.

DropView

Class that is used to drop a view. Every instance will be compiled into a SQL DROP VIEW statement.

PickUpWithContextView

View for pickup actions with context.

Functions

_create_view(→ str)

Compiles a CreateView instance into a SQL CREATE VIEW statement.

_drop_view(→ str)

Compiles a DropView instance into a SQL DROP VIEW statement.

view_exists(→ bool)

Check if a view exists.

view_doesnt_exist(→ bool)

Check if a view does not exist.

view(→ sqlalchemy.TableClause)

Function used to control view creation and deletion. It will listen to the after_create and before_drop events

Attributes

base

class pycram.orm.views.CreateView(name: str, selectable: sqlalchemy.Select)

Bases: sqlalchemy.ExecutableDDLElement

Class that is used to create a view. Every instance will be compiled into a SQL CREATE VIEW statement.

class pycram.orm.views.DropView(name: str)

Bases: sqlalchemy.ExecutableDDLElement

Class that is used to drop a view. Every instance will be compiled into a SQL DROP VIEW statement.

pycram.orm.views._create_view(element: CreateView, compiler, **kw) str

Compiles a CreateView instance into a SQL CREATE VIEW statement. :param element: CreateView instance :param compiler: compiler :param kw: keyword arguments :return: SQL CREATE VIEW statement

pycram.orm.views._drop_view(element: DropView, compiler, **kw) str

Compiles a DropView instance into a SQL DROP VIEW statement. :param element: DropView instance :param compiler: compiler :param kw: keyword arguments :return: SQL DROP VIEW statement

pycram.orm.views.view_exists(ddl: typing_extensions.Union[CreateView, DropView], target, connection: sqlalchemy.engine, **kw) bool

Check if a view exists. :param ddl: ddl instance :param target: target object :param connection: connection :param kw: keyword arguments :return: True if the view exists, False otherwise

pycram.orm.views.view_doesnt_exist(ddl: typing_extensions.Union[CreateView, DropView], target, connection: sqlalchemy.engine, **kw) bool

Check if a view does not exist. :param ddl: ddl instance :param target: target object :param connection: connection :param kw: keyword arguments :return: True if the view does not exist, False otherwise

pycram.orm.views.view(name: str, metadata: sqlalchemy.MetaData, selectable: sqlalchemy.Select) sqlalchemy.TableClause

Function used to control view creation and deletion. It will listen to the after_create and before_drop events of the metadata object in order to either create or drop the view. The view needs to have a column id.

pycram.orm.views.base
class pycram.orm.views.PickUpWithContextView

Bases: base

View for pickup actions with context.

__robot_position: pycram.orm.base.Position

3D Vector of robot position

__robot_pose: pycram.orm.base.Pose

Complete robot pose

__object_position: pycram.orm.base.Position

3D Vector for object position

__relative_x

Distance on x axis between robot and object

__relative_y

Distance on y axis between robot and object

__table__