Home | Trees | Indices | Help |
|
---|
|
Utilities
Requires: gluon
Copyright: (c) 2010-2019 Sahana Software Foundation
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Classes | |
S3PriorityRepresent Color-coded representation of priorities |
|
Traceback Generate the traceback for viewing error Tickets |
|
S3CustomController Base class for custom controllers (template/controllers.py), implements common helper functions |
|
S3TypeConverter Universal data type converter |
|
S3MultiPath Simplified path toolkit for managing multi-ancestor-hypergraphs in a relational database. |
|
StringTemplateParser Helper to parse string templates with named keys |
|
S3MarkupStripper Simple markup stripper |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Variables | |
URLSCHEMA = re.compile(r"((?:(())(www\.([^/?#\s]*))|((http(s)?
|
|
RCVARS = "rcvars"
|
Function Details |
Reads the last record ID for a resource from a session
|
Stores a record ID for a resource in a session
|
Clears one or all last record IDs stored in a session
|
Validates a value for a field
|
Represent a field value
|
Developer Toolbar - ported from gluon.Response.toolbar() Shows useful stuff at the bottom of the page in Debug mode |
Default HTML for labels of required form fields |
Add asterisk to field label if a field is required
|
Add a row to a form, applying formstyle
|
Nice truncating of text
|
Representation method to override the dataTables-internal truncation of strings per field, like: if not r.id and not r.method: table.field.represent = lambda string: s3_datatable_truncate(string, maxlength=40) @param string: the string @param maxlength: the maximum string length @note: the JS click-event will be attached by s3.ui.datatable.js |
Intelligent client-side text truncation
|
Representation function for text fields with intelligent truncation and preserving whitespace.
|
Formats the full name of a person
|
Returns the full name of a person
|
Returns the full name for a set of Persons - currently unused @param record_ids: a list of record_ids @param truncate: truncate the name to max 24 characters |
Represent Comments Fields |
Ensure that Phone numbers always show as LTR - otherwise + appears at the end which looks wrong even in RTL |
Make URLs clickable |
Convert all URLs in a text into an HTML <A> tag.
|
Represent a User as their profile picture or Gravatar
|
Represent a user as their email address |
Represent users by their names |
Represent a Boolean field as Yes/No instead of True/False |
Redirect preserving response messages, useful when redirecting from index() controllers.
|
Generates html to include the css listed in /modules/templates/<theme>/css.cfg |
Generates html to include the js scripts listed in /static/scripts/tools/sahana.js.cfg |
Add ExtJS CSS & JS into a page for a Map - since this is normally run from MAP.xml() it is too late to insert into s3.[external_]stylesheets, so must inject sheets into correct order |
Add Undercore JS into a page - for Map templates - for templates in GroupedOptsWidget comment |
Simple UA Test whether client is a mobile device |
Use WURFL for browser compatibility detection To Do: define a list of features to store |
Convert a string into a valid filename on all OS http://stackoverflow.com/questions/295135/turn-a-string-into-a-valid-filename-in-python/698714#698714 - currently unused |
Check whether a field contains a foreign key constraint
Note: many-to-many references (list:reference) are not DB constraints, but pseudo-references implemented by the DAL. If you only want to find real foreign key constraints, then set m2m=False. |
Resolve a field type into the name of the referenced table, the referenced key and the reference type (M:1 or M:N)
Note: many-to-many references (list:reference) are not DB constraints, but pseudo-references implemented by the DAL. If you only want to find real foreign key constraints, then set m2m=False. |
Convert an object into an unicode instance, to be used instead of unicode(s)
|
Unicode-safe conversion of an object s into a utf-8 encoded str, to be used instead of str(s)
Note: assumes utf-8, for other character encodings use explicit:
|
Iterator to flatten mixed iterables of arbitrary depth |
Helper method for gis_search_ac and org_search_ac Find which field the search term matched & where
|
Introspect and yield all fields involved in a DAL orderby expression.
|
Get the file extension in the path of the request
|
Add a file extension to the path of a url, replacing all other extensions in the path.
|
Unpickle and convert saved search form variables into a human-readable HTML.
|
Return Jaro_Winkler distance of two strings (between 0.0 and 1.0) Used as a measure of similarity between two strings
Status: currently unused |
Calculate the percentage match for two db records To Do: parameter description? Status: currently unused |
Code referenced from http://code.activestate.com/recipes/52213-soundex-algorithm/ To Do: parameter description? |
Sort a dict by value and return an OrderedDict - used by modules/eden/irs.py |
Modified version of URL from gluon/html.py
|
|
Variables Details |
URLSCHEMA
|
RCVARS
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Mar 15 08:51:49 2019 | http://epydoc.sourceforge.net |