Package s3 :: Module s3organizer :: Class S3Organizer
[frames] | no frames]

Class S3Organizer

source code

     object --+    
              |    
s3rest.S3Method --+
                  |
                 S3Organizer

Calendar-based CRUD Method

Instance Methods
 
apply_method(self, r, **attr)
Page-render entry point for REST interface.
source code
 
organizer(self, r, **attr)
Render the organizer view (HTML method)
source code
 
get_json_data(self, r, **attr)
Extract the resource data and return them as JSON (Ajax method)
source code
 
update_json(self, r, **attr)
Update or delete calendar items (Ajax method)
source code

Inherited from s3rest.S3Method: __call__, widget

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods
 
parse_config(cls, resource)
Parse the resource configuration and add any fallbacks
source code
Static Methods
 
parse_interval(intervalstr)
Parse an interval string of the format "<ISO8601>--<ISO8601>" into a pair of datetimes
source code
 
prefix_selector(resource, selector)
Helper method to prefix an unprefixed field selector
source code
 
formname(r) source code
 
isoformat(dt)
Format a date/datetime as ISO8601 datetime string
source code

Inherited from s3rest.S3Method: crud_string

Properties

Inherited from object: __class__

Method Details

apply_method(self, r, **attr)

source code 

Page-render entry point for REST interface.

Parameters:
  • r - the S3Request instance
  • attr - controller attributes
Returns:
output object to send to the view
Overrides: s3rest.S3Method.apply_method

organizer(self, r, **attr)

source code 

Render the organizer view (HTML method)

Parameters:
  • r - the S3Request instance
  • attr - controller attributes
Returns:
dict of values for the view

get_json_data(self, r, **attr)

source code 

Extract the resource data and return them as JSON (Ajax method)

@param r: the S3Request instance
@param attr: controller attributes

TODO correct documentation!
@returns: JSON string containing an array of items, format:
          [{"id": the record ID,
            "title": the record title,
            "start": start date as ISO8601 string,
            "end": end date as ISO8601 string (if resource has end dates),
            "description": array of item values to render a description,
            TODO:
            "editable": item date/duration can be changed (true|false),
            "deletable": item can be deleted (true|false),
            },
           ...
           ]

update_json(self, r, **attr)

source code 

Update or delete calendar items (Ajax method)

Parameters:
  • r - the S3Request instance
  • attr - controller attributes

parse_config(cls, resource)
Class Method

source code 

Parse the resource configuration and add any fallbacks

@param resource: the S3Resource

@returns: the resource organizer configuration, format:
          {"start": S3ResourceField,
           "end": S3ResourceField or None,
           "use_time": whether this resource has timed events,
           "title": selector or callable to produce item titles,
           "description": list of selectors for the item description,
           }

parse_interval(intervalstr)
Static Method

source code 

Parse an interval string of the format "<ISO8601>--<ISO8601>" into a pair of datetimes

Parameters:
  • intervalstr - the interval string
Returns:
tuple of datetimes (start, end)

prefix_selector(resource, selector)
Static Method

source code 

Helper method to prefix an unprefixed field selector

Parameters:
  • resource - the target resource
  • selector - the field selector
Returns:
the prefixed selector

formname(r)
Static Method

source code 

isoformat(dt)
Static Method

source code 

Format a date/datetime as ISO8601 datetime string

Parameters:
  • dt - the date/datetime instance
Returns:
the ISO-formatted datetime string, or None if dt was None