Package turbogears :: Package widgets :: Module big_widgets :: Class CalendarDatePicker
[hide private]

Class CalendarDatePicker

source code


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

Nested Classes [hide private]
  template_c

Inherited from base.Widget: __metaclass__

Instance Methods [hide private]
 
__init__(self, *args, **kw)
Initializes an input widget.
source code
 
_get_default(self) source code
 
update_params(self, d)
This method will have the last chance to update the variables sent to the template for the specific request.
source code

Inherited from forms.InputWidget: adjust_value, display

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

Inherited from base.Widget (private): _get_is_named

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

Class Variables [hide private]
  template = '\n <div xmlns:py="http://purl.org/kid/ns#">\n ...
  params = ['attrs', 'skin', 'picker_shows_time', 'button_text',...
  params_doc = {'attrs': 'Extra attributes', 'button_text': 'Tex...
  attrs = {}
  skin = "calendar-system"
  picker_shows_time = False
  button_text = "Choose"
  format = "%m/%d/%Y"
  calendar_lang = None
  _default = None
  _param_attrs = {}
  _param_button_text = 'Choose'
  _param_calendar_lang = None
  _param_format = '%m/%d/%Y'
  _param_picker_shows_time = False
  _param_skin = 'calendar-system'
  template_vars = ['attrs', 'skin', 'picker_shows_time', 'button...

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

Inherited from forms.InputWidget: convert, validator

Inherited from forms.InputWidget (private): _param_convert

Inherited from base.Widget: css, javascript

Inherited from base.Widget (private): _locked

Properties [hide private]
  default

Inherited from forms.FormField: field_id, is_required, name

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

Inherited from base.Widget: is_named

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kw)
(Constructor)

source code 
Initializes 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)

update_params(self, d)

source code 

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 [hide private]

template

Value:
'''
    <div xmlns:py="http://purl.org/kid/ns#">
    <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',
 'calendar_lang',
 'field_class',
 'css_classes',
...

params_doc

Value:
{'attrs': 'Extra attributes',
 'button_text': 'Text for the button that will show the calendar picke\
r',
 'calendar_lang': 'The language to be used in the calendar picker.',
 'convert': 'Should the value be coerced by the validator at display?'\
,
 'css_classes': 'List of extra CSS classes for the field',
 'field_class': 'CSS class for the field',
...

template_vars

Value:
['attrs',
 'skin',
 'picker_shows_time',
 'button_text',
 'format',
 'calendar_lang',
 'field_class',
 'css_classes',
...

Property Details [hide private]

default

Get Method:
_get_default(self)