container

Container classes are classes that are used to transport data between the model thread and the GUI thread.

When complex data sets need to be visualized (eg.: charts, intervals), built-in python types don’t contain enough information, while dictionary like structures are not self documented. Hence the need of specialized container classes to transport this data between the model and the GUI.

To use this classes :

  1. On your model class, define properties returning a container class
  2. In the admin class, add the property to the list of fields to visualize, and specify its delegate

eg:

class MyEntity(Entity):

@property def my_interval(self):

return IntervalsContainer()
class Admin(EntityAdmin):
form_display = [‘my_interval’] field_attributes = dict(my_interval=dict(delegate=IntervalsDelegate))
class camelot.container.Arrow(x, y, width)[source]

Container to describe arrows

class camelot.container.Container[source]

Top level class for all container classes

class camelot.container.Interval(begin, end, name='', color=2)[source]

Helper class for IntervalsContainer, specifications for one interval

class camelot.container.IntervalsContainer(min, max, intervals)[source]

Containter to hold interval data

eg : representing the time frame of 8pm till 6am that someone was at work using an hourly precision :

intervals = IntervalsContainer(0, 24, [Interval(8, 18, ‘work’)])

Previous topic

meta

Next topic

chartcontainer

This Page