Skipole WSGI generator.

Topics:

Introduction Getting Started Your Code skiadmin start_call submit_data end_call Exceptions PageData SectionData skicall Serving wsgi Code Examples

Development at GitHub:

github.com/bernie-skipole/skipole

SectionData

As well as page widgets and fields, you can also set section widget and field data into the skicall object.

To do this, create a SectionData object.

from skipole import SectionData

sd = SectionData("sectionalias") - sectionalias being the alias given to the section when inserted into a page.

This instance is a dictionary-like object that also has certain attributes. It can be set with data, and then inserted into the skicall object with:

skicall.update(sd)

or it can be inserted into a PageData instance with:

pd.update(sd)

The keys of the SectionData instance sd are of the form:

sd[widgetname,fieldname] = value

This framework often refers to the key tuple (widgetname,fieldname) as a widgfield.

As well as dictionary keys, attributes can be set:

sd.hide - If True, the section will be hidden.

sd.multiplier - If set to a number, the section will be multiplied down the page.

sd.multiplier_tag - if multiplied, this sets the containing tag, typically "div".

sd.section_class - Sets the CSS class of the section.

sd.show - Normally True, if set False, the section is not included in the page.

Methods

SectionData.from_dict(sectiondict)

This classmethod returns an instance of the SectionData class given a dictionary as produced by the to_dict method.

sd.to_dict()

Returns a dictionary containing all the information of the SectionData object, with keys as a string. This may be useful for storing the data in a cache or database.

sd.clear()

Clears all data from the instance.

sd.copy(newalias)

Returns a copy of this section with a new sectionalias

sd.multiply(number)

Sets the sd.multiplier to number and returns the given number of SectionData objects each with sectionalias of sectionalias_0, sectionalias_1,.. etc