Package s3 :: Module s3data :: Class S3DataList
[frames] | no frames]

Class S3DataList

source code

object --+
         |
        S3DataList

Class representing a list of data cards -clien-side implementation in static/scripts/S3/s3.dataLists.js

Instance Methods
 
__init__(self, resource, list_fields, records, start=None, limit=None, total=None, list_id=None, layout=None, row_layout=None)
Constructor
source code
 
html(self, start=None, limit=None, pagesize=None, rowsize=None, ajaxurl=None, empty=None, popup_url=None, popup_title=None)
Render list data as HTML (nested DIVs)
source code

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

Static Methods
 
groups(iterable, length)
Iterator to group data list items into rows
source code
Properties

Inherited from object: __class__

Method Details

__init__(self, resource, list_fields, records, start=None, limit=None, total=None, list_id=None, layout=None, row_layout=None)
(Constructor)

source code 

Constructor

Parameters:
  • resource - the S3Resource
  • list_fields - the list fields (list of field selector strings)
  • records - the records
  • start - index of the first item
  • limit - maximum number of items
  • total - total number of available items
  • list_id - the HTML ID for this list
  • layout - item renderer (optional) as function (list_id, item_id, resource, rfields, record)
  • row_layout - row renderer (optional) as function(list_id, resource, rowsize, items)
Overrides: object.__init__

html(self, start=None, limit=None, pagesize=None, rowsize=None, ajaxurl=None, empty=None, popup_url=None, popup_title=None)

source code 

Render list data as HTML (nested DIVs)

Parameters:
  • start - index of the first item (in this page)
  • limit - total number of available items
  • pagesize - maximum number of items per page
  • rowsize - number of items per row
  • ajaxurl - the URL to Ajax-update the datalist
  • empty - message to display if the list is empty
  • popup_url - the URL for the modal used for the 'more' button (=> we deactivate InfiniteScroll)
  • popup_title - the title for the modal

groups(iterable, length)
Static Method

source code 

Iterator to group data list items into rows

Parameters:
  • iterable - the items iterable
  • length - the number of items per row