EasyWidgets Module Reference
-
class ew.widget.ExprTemplate(template)[source]
-
class ew.widget.Widget(**kw)[source]
-
display(**kw)[source]
-
expand(template)[source]
-
classmethod get_params()[source]
-
prepare_context(context)[source]
-
resources()[source]
-
class ew.resource.CSSLink(url, squash=True, compress=True, **attrs)[source]
-
class ew.resource.CSSScript(text)[source]
-
class ew.resource.GoogleAnalytics(account)[source]
-
class ew.resource.JSLink(url, location='body_js', squash=True, compress=True)[source]
-
class ew.resource.JSScript(text, location='body_js_tail', squash=True, compress=True)[source]
-
class ew.resource.Resource(location, squash=True, compress=True)[source]
-
classmethod compressed(manager, resources)[source]
-
display()[source]
-
class ew.resource.ResourceHolder(*resources)[source]
Simple widget that does nothing but hold resources
-
resources()[source]
-
class ew.resource.ResourceLink(url, location, squash, compress)[source]
-
classmethod compressed(manager, resources)[source]
-
url()[source]
-
class ew.resource.ResourceManager(script_name='/_ew_resources/', compress=False, url_base=None, cache_max_age=31536000, use_cache=True, use_jsmin=False, use_cssmin=False)[source]
-
classmethod configure(**kw)[source]
-
emit(location)[source]
-
get_filename(res_path)[source]
Translate a resource path to a filename
-
register(resource)[source]
Registers the required resources for the given resource/widget
-
classmethod register_all_resources()[source]
-
classmethod register_directory(url_path, directory)[source]
-
register_widgets(context)[source]
Registers all the widget/resource-type objects that exist as attrs on
context
-
serve_slim(file_type, href)[source]
Serve a ‘slim’ version of a file (concat+minify, if possible)
-
url_base[source]
-
class ew.resource.ResourceScript(text, location, squash, compress)[source]
-
classmethod compressed(manager, resources)[source]
-
class ew.middleware.WidgetMiddleware(app, compress=False, script_name='/_ew_resources/', url_base=None, cache_max_age=31536000, register_resources=True, use_jsmin=False, use_cssmin=False, **extra_config)[source]
-
serve_resource(mgr, res_path, environ, start_response)[source]
-
serve_slim_css(mgr, res_path, environ, start_response)[source]
-
serve_slim_js(mgr, res_path, environ, start_response)[source]
-
class ew.fields.Checkbox(**kw)[source]
Messages
-
classmethod from_python(value, state)[source]
-
class ew.fields.CompoundField(**kw)[source]
Messages
-
context_for(field)[source]
-
classmethod from_python(value, state=None)[source]
-
prepare_context(context)[source]
-
resources()[source]
-
classmethod to_python(*a, **kw)[source]
-
class ew.fields.DateField(**kw)[source]
Messages
-
class ew.fields.EmailField(**kw)[source]
Messages
-
class ew.fields.FieldSet(**kw)[source]
Messages
-
class ew.fields.FieldWidget(**kw)[source]
- Widget that also functions as a validator. Base class for all Form Field
- widgets.
Messages
-
classmethod from_python(value, state)[source]
-
prepare_context(context)[source]
-
classmethod to_python(*a, **kw)[source]
-
validate(*a, **kw)[source]
-
class ew.fields.HTMLField(**kw)[source]
-
class ew.fields.HiddenField(**kw)[source]
Messages
-
class ew.fields.InputField(**kw)[source]
Messages
-
if_missing
-
class ew.fields.IntField(**kw)[source]
Messages
-
class ew.fields.LinkField(**kw)[source]
-
class ew.fields.NumberField(**kw)[source]
Messages
-
class ew.fields.RepeatedField(**kw)[source]
Messages
-
context_for(repetition)[source]
-
classmethod from_python(value, state=None)[source]
-
name
-
prepare_context(context)[source]
-
resources()[source]
-
classmethod to_python(*a, **kw)[source]
-
class ew.fields.RowField(**kw)[source]
Messages
-
class ew.fields.SubmitButton(**kw)[source]
Messages
-
class ew.fields.TableField(**kw)[source]
Messages
-
class RowField(**kw)
Messages
-
class ew.fields.TextArea(**kw)[source]
Messages
-
class ew.fields.TextField(**kw)[source]
Messages
-
class ew.fields.TimeField(**kw)[source]
Messages
-
class ew.select.CheckboxSet(**kwargs)[source]
Messages
-
class ew.select.MultiSelectField(**kwargs)[source]
Messages
-
class ew.select.Option(**kw)[source]
-
class ew.select.SelectField(**kwargs)[source]
Messages
-
classmethod from_python(value, state=None)[source]
-
prepare_context(context)[source]
-
classmethod to_python(*a, **kw)[source]
-
class ew.select.SingleSelectField(**kwargs)[source]
Messages
-
class ew.forms.SimpleForm(**kw)[source]
Messages
-
class SubmitButton(**kw)
Messages
-
SimpleForm.prepare_context(context)[source]
Implementation of core ew widgets in terms of kajiki-html4 templates
-
class ew.kajiki_ew.CSSLink(url, squash=True, compress=True, **attrs)[source]
-
class WidgetClass(**kw)[source]
-
class ew.kajiki_ew.CSSScript(text)[source]
-
class WidgetClass(**kw)[source]
-
class ew.kajiki_ew.Checkbox(**kw)[source]
Messages
-
class ew.kajiki_ew.CheckboxSet(**kwargs)[source]
Messages
-
class ew.kajiki_ew.CompoundField(**kw)[source]
Messages
-
class ew.kajiki_ew.DateField(**kw)[source]
Messages
-
class ew.kajiki_ew.EmailField(**kw)[source]
Messages
-
class ew.kajiki_ew.FieldSet(**kw)[source]
Messages
-
class ew.kajiki_ew.GoogleAnalytics(account)[source]
-
class WidgetClass(**kw)[source]
-
class ew.kajiki_ew.HTMLField(**kw)[source]
-
class ew.kajiki_ew.HiddenField(**kw)[source]
Messages
-
class ew.kajiki_ew.InputField(**kw)[source]
Messages
-
class ew.kajiki_ew.IntField(**kw)[source]
Messages
-
class ew.kajiki_ew.JSLink(url, location='body_js', squash=True, compress=True)[source]
-
class WidgetClass(**kw)[source]
-
class ew.kajiki_ew.JSScript(text, location='body_js_tail', squash=True, compress=True)[source]
-
class WidgetClass(**kw)[source]
-
class ew.kajiki_ew.LinkField(**kw)[source]
-
class ew.kajiki_ew.MultiSelectField(**kwargs)[source]
Messages
-
class ew.kajiki_ew.NumberField(**kw)[source]
Messages
-
class ew.kajiki_ew.Option(**kw)[source]
-
class ew.kajiki_ew.RepeatedField(**kw)[source]
Messages
-
class ew.kajiki_ew.RowField(**kw)[source]
Messages
-
class ew.kajiki_ew.SelectField(**kwargs)[source]
Messages
-
class ew.kajiki_ew.SimpleForm(**kw)[source]
Messages
-
class SubmitButton(**kw)
Messages
-
class ew.kajiki_ew.SingleSelectField(**kwargs)[source]
Messages
-
class ew.kajiki_ew.SubmitButton(**kw)[source]
Messages
-
class ew.kajiki_ew.TableField(**kw)[source]
Messages
-
class RowField(**kw)
Messages
-
class ew.kajiki_ew.TextArea(**kw)[source]
Messages
-
class ew.kajiki_ew.TextField(**kw)[source]
Messages
-
class ew.kajiki_ew.TimeField(**kw)[source]
Messages
Implementation of core ew widgets in terms of Jinja2 templates
-
class ew.jinja2_ew.CSSLink(url, squash=True, compress=True, **attrs)[source]
-
class WidgetClass(**kw)[source]
Messages
-
class ew.jinja2_ew.CSSScript(text)[source]
-
class WidgetClass(**kw)[source]
Messages
-
class ew.jinja2_ew.Checkbox(**kw)[source]
Messages
-
class ew.jinja2_ew.CheckboxSet(**kwargs)[source]
Messages
-
class ew.jinja2_ew.CompoundField(**kw)[source]
Messages
-
class ew.jinja2_ew.DateField(**kw)[source]
Messages
-
class ew.jinja2_ew.EmailField(**kw)[source]
Messages
-
class ew.jinja2_ew.FieldSet(**kw)[source]
Messages
-
class ew.jinja2_ew.GoogleAnalytics(account)[source]
-
class WidgetClass(**kw)[source]
Messages
-
class ew.jinja2_ew.HTMLField(**kw)[source]
Messages
-
class ew.jinja2_ew.HiddenField(**kw)[source]
Messages
-
class ew.jinja2_ew.InputField(**kw)[source]
Messages
-
class ew.jinja2_ew.IntField(**kw)[source]
Messages
-
class ew.jinja2_ew.JSLink(url, location='body_js', squash=True, compress=True)[source]
-
class WidgetClass(**kw)[source]
Messages
-
class ew.jinja2_ew.JSScript(text, location='body_js_tail', squash=True, compress=True)[source]
-
class WidgetClass(**kw)[source]
Messages
-
class ew.jinja2_ew.LinkField(**kw)[source]
Messages
-
class ew.jinja2_ew.MultiSelectField(**kwargs)[source]
Messages
-
class ew.jinja2_ew.NumberField(**kw)[source]
Messages
-
class ew.jinja2_ew.Option(**kw)[source]
Messages
-
class ew.jinja2_ew.RepeatedField(**kw)[source]
Messages
-
class ew.jinja2_ew.RowField(**kw)[source]
Messages
-
class ew.jinja2_ew.SelectField(**kwargs)[source]
Messages
-
class ew.jinja2_ew.SimpleForm(**kw)[source]
Messages
-
class SubmitButton(**kw)
Messages
-
class ew.jinja2_ew.SingleSelectField(**kwargs)[source]
Messages
-
class ew.jinja2_ew.SubmitButton(**kw)[source]
Messages
-
class ew.jinja2_ew.TableField(**kw)[source]
Messages
-
class RowField(**kw)
Messages
-
class ew.jinja2_ew.TextArea(**kw)[source]
Messages
-
class ew.jinja2_ew.TextField(**kw)[source]
Messages
-
class ew.jinja2_ew.TimeField(**kw)[source]
Messages
-
exception ew.errors.EasyWidgetsError[source]
-
exception ew.errors.EngineNotFound[source]
-
exception ew.errors.TemplateNotFound[source]
-
class ew.utils.Bunch[source]
-
ew.utils.LazyProperty[source]
-
class ew.utils.NameList(iterator=None, index=None)[source]
Simple class to let you create a list of widgets declaratively
-
append(item)[source]
-
class ew.utils.NameListItem[source]
An item that ‘remembers’ its order of instantiation within a thread
-
class ew.utils.NoDefault[source]
-
ew.utils.push_context(*args, **kwds)[source]
Temporarily add attributes to ‘obj’, restoring ‘obj’ to its original
state on __exit__
-
ew.utils.safe_getitem(dct, key, item)[source]
Return either dct[key][item], dct[key].item, or None, whichever
is appropriate
-
class ew.render.CoreEngine(entry_point, config)[source]
Simple extension of string.Template allowing for expressions in ${...}
-
class ExprDict[source]
-
get(k, *args)[source]
-
class CoreEngine.ExprTemplate(template)[source]
-
CoreEngine.load(template_name)[source]
-
CoreEngine.parse(template_text, filepath=None)[source]
-
CoreEngine.render(template, context)[source]
-
class ew.render.File(text='', engine=None)[source]
-
class ew.render.GenshiEngine(entry_point, config)[source]
-
load(template_name)[source]
-
parse(template_text, filepath=None)[source]
-
render(template, context)[source]
-
class ew.render.Jinja2Engine(entry_point, config)[source]
-
get_source(template_name)[source]
-
load(template_name)[source]
-
parse(template_text, filepath=None)[source]
-
render(template, context)[source]
-
class ew.render.JsonEngine(entry_point, config)[source]
-
load(template_name)[source]
-
parse(template_text, filepath=None)[source]
-
render(template, context)[source]
-
class ew.render.KajikiEngine(entry_point, config)[source]
-
load(template_name)[source]
-
parse(template_text, filepath=None)[source]
-
render(template, context)[source]
-
class ew.render.KajikiHTML4Engine(entry_point, config)[source]
-
class ew.render.KajikiHTML5Engine(entry_point, config)[source]
-
class ew.render.KajikiTextEngine(entry_point, config)[source]
-
parse(template_text, filepath=None)[source]
-
class ew.render.KajikiXMLEngine(entry_point, config)[source]
-
class ew.render.Snippet(text='', engine=None)[source]
-
class ew.render.TemplateEngine(entry_point, config)[source]
-
context(user_context)[source]
-
classmethod get_engine(name)[source]
-
classmethod initialize(config)[source]
-
load(template_name)[source]
-
parse(template_text)[source]
-
classmethod register_variable_provider(provider)[source]
Plugin point to allow functions to manipulate the context
passed to all templates for all widgets.
def provider(context): ...
TemplateEngine.register_variable_provider(provider)
-
render(template, context)[source]
-
class ew.validators.Currency(*args, **kw)[source]
Messages
- badType:
- The input must be a string (not a %(type)s: %(value)r)
- empty:
- Please enter a value
- noneType:
- The input must be a string (not None)
- number:
- Please enter a number
- tooHigh:
- Please enter a number that is %(max)s or smaller
- tooLow:
- Please enter a number that is %(min)s or greater
-
classmethod from_python(value, state)[source]
-
class ew.validators.DateConverter(*args, **kw)[source]
Messages
- badFormat:
- Please enter the date in the form %(format)s
- badType:
- The input must be a string (not a %(type)s: %(value)r)
- dayRange:
- That month only has %(days)i days
- empty:
- Please enter a value
- fourDigitYear:
- Please enter a four-digit year after 1899
- invalidDate:
- That is not a valid day (%(exception)s)
- invalidDay:
- Please enter a valid day
- invalidYear:
- Please enter a number for the year
- monthRange:
- Please enter a month from 1 to 12
- noneType:
- The input must be a string (not None)
- unknownMonthName:
- Unknown month name: %(month)s
- wrongFormat:
- Please enter the date in the form %(format)s
-
classmethod to_python(value, state)[source]
-
class ew.validators.OneOf(options)[source]
Messages
- badType:
- The input must be a string (not a %(type)s: %(value)r)
- empty:
- Please enter a value
- invalid:
- Invalid Value
- noneType:
- The input must be a string (not None)
- notIn:
- Value must be one of: %(items)s (not %(value)r)
-
validate_python(value, state)[source]
-
class ew.validators.TimeConverter(*args, **kw)[source]
Messages
- badHour:
- You must enter an hour in the range %(range)s
- badMinute:
- You must enter a minute in the range 0-59
- badNumber:
- The %(part)s value you gave is not a number: %(number)r
- badSecond:
- You must enter a second in the range 0-59
- badType:
- The input must be a string (not a %(type)s: %(value)r)
- empty:
- Please enter a value
- minutesRequired:
- You must enter minutes (after a :)
- noAMPM:
- You must indicate AM or PM
- noSeconds:
- You may not enter seconds
- noneType:
- The input must be a string (not None)
- secondsRequired:
- You must enter seconds
- tooManyColon:
- There are too many :’s
-
class ew.validators.UnicodeString(**kw)[source]
Messages
- badEncoding:
- Invalid data or incorrect encoding
- badType:
- The input must be a string (not a %(type)s: %(value)r)
- empty:
- Please enter a value
- noneType:
- The input must be a string (not None)
- tooLong:
- Enter a value less than %(max)i characters long
- tooShort:
- Enter a value %(min)i characters long or more
-
classmethod from_python(value, state)[source]