Package turbogears :: Package widgets :: Module big_widgets :: Class CalendarDatePicker

Class CalendarDatePicker

source code

   object --+            
            |            
  base.Widget --+        
                |        
forms.InputWidget --+    
                    |    
      forms.FormField --+
                        |
                       CalendarDatePicker

Use a Javascript calendar system to allow picking of calendar dates.

Instance Methods
 
__init__(self, name=None, default=None, not_empty=True, calendar_lang=None, validator=None, format=None, **kw)
Initialize an input widget.
source code
 
default(self)
hash(x)
source code
 
update_params(self, d)
Update the template parameters.
source code

Inherited from forms.FormField: field_id, is_required

Inherited from forms.InputWidget: adjust_value, display, error, fq_name, is_validated, name_path, path, render

Inherited from base.Widget: __call__, __repr__, __setattr__, is_named, retrieve_css, retrieve_javascript

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

Class Variables
  template = ...
hash(x)
  params = ["attrs", "skin", "picker_shows_time", "button_text",...
  params_doc = {'attrs': 'Extra attributes', 'skin': 'For altern...
  attrs = {}
  skin = "calendar-system"
  picker_shows_time = False
hash(x)
  button_text = "Choose"
  format = "%m/%d/%Y"
  calendar_lang = None
hash(x)

Inherited from forms.FormField: css_classes, field_class, help_text, label, name

Inherited from forms.InputWidget: convert, validator

Inherited from base.Widget: __metaclass__, css, engine_name, javascript

Properties

Inherited from object: __class__

Method Details

__init__(self, name=None, default=None, not_empty=True, calendar_lang=None, validator=None, format=None, **kw)
(Constructor)

source code 
Initialize an input widget.

It accepts the following parameters (besides those listed at params):

name:
    Name of the input element. Will be the name of the variable
    the widget's input will be available at when submitted.

validator:
    Formencode validator that will validate and coerce the input
    this widget generates.

Overrides: object.__init__
(inherited documentation)

default(self)

source code 

hash(x)

Overrides: default

update_params(self, d)

source code 

Update the template parameters.

This method will have the last chance to update the variables sent to the template for the specific request. All parameters listed at class attribute 'params' will be available at the 'params' dict this method receives.

*Must* call super(MyWidget, self).update_params(params) cooperatively, unless, of course, your know what you're doing. Preferably this should be done before any actual work is done in the method.

Overrides: base.Widget.update_params
(inherited documentation)

Class Variable Details

template

hash(x)

Value:
"""
    <span xmlns:py="http://purl.org/kid/ns#" class="${field_class}">
    <input type="text" id="${field_id}" class="${field_class}" name="$\
{name}" value="${strdate}" py:attrs="attrs"/>
    <input type="button" id="${field_id}_trigger" class="date_field_bu\
tton" value="${button_text}"/>
    <script type="text/javascript">
    Calendar.setup({
...

params

Value:
["attrs", "skin", "picker_shows_time", "button_text", "format", "calen\
dar_lang"]

params_doc

Value:
{'attrs': 'Extra attributes', 'skin': 'For alternate skins, such as "c\
alendar-blue" or "skins/aqua/theme"', 'picker_shows_time': 'Whether th\
e calendar should let you pick a time, too', 'button_text': 'Text for \
the button that will show the calendar picker', 'format': 'The date fo\
rmat (default is mm/dd/yyyy)', 'calendar_lang': 'The language to be us\
ed in the calendar picker.'}