Package s3 :: Module s3filter :: Class S3FilterForm
[frames] | no frames]

Class S3FilterForm

source code

object --+
         |
        S3FilterForm

Helper class to construct and render a filter form for a resource

Instance Methods
 
__init__(self, widgets, **attr)
Constructor
source code
 
html(self, resource, get_vars=None, target=None, alias=None)
Render this filter form as HTML form.
source code
 
fields(self, resource, get_vars=None, alias=None)
Render the filter widgets without FORM wrapper, e.g.
source code
 
json(self, resource, get_vars=None)
Render this filter form as JSON (for Ajax requests)
source code

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

Static Methods
 
apply_filter_defaults(request, resource)
Add default filters to resource, to be called a multi-record view with a filter form is rendered the first time and before the view elements get processed
source code
Properties

Inherited from object: __class__

Method Details

__init__(self, widgets, **attr)
(Constructor)

source code 

Constructor

Parameters:
  • widgets - the widgets (as list)
  • attr - HTML attributes for this form
Overrides: object.__init__

html(self, resource, get_vars=None, target=None, alias=None)

source code 

Render this filter form as HTML form.

Parameters:
  • resource - the S3Resource
  • get_vars - the request GET vars (URL query dict)
  • target - the HTML element ID of the target object for this filter form (e.g. a datatable)
  • alias - the resource alias to use in widgets

fields(self, resource, get_vars=None, alias=None)

source code 

Render the filter widgets without FORM wrapper, e.g. to embed them as fieldset in another form.

Parameters:
  • resource - the S3Resource
  • get_vars - the request GET vars (URL query dict)
  • alias - the resource alias to use in widgets

json(self, resource, get_vars=None)

source code 

Render this filter form as JSON (for Ajax requests)

Parameters:
  • resource - the S3Resource
  • get_vars - the request GET vars (URL query dict)

apply_filter_defaults(request, resource)
Static Method

source code 

Add default filters to resource, to be called a multi-record view with a filter form is rendered the first time and before the view elements get processed

Parameters:
  • request - the request
  • resource - the resource
Returns:
dict with default filters (URL vars)