PaferaPy Async 0.1
ASGI framework focused on simplicity and efficiency
Loading...
Searching...
No Matches
Namespaces | Functions
utils.py File Reference

Go to the source code of this file.

Namespaces

namespace  pafera
 
namespace  pafera.utils
 

Functions

def pafera.utils.b64decodepad (s)
 Helper function to ensure that a b64 string is correctly padded to four spaces. More...
 
def pafera.utils.BestTranslation (translations, languages, defaultlang='en')
 Returns the best translation found in a dict of different translations. More...
 
def pafera.utils.Bound (val, min, max)
 Returns a value that is no smaller than min or larger than max. More...
 
def pafera.utils.CodeDir (code)
 Separates a filename into three character segments with the directory separator '/' in between. More...
 
def pafera.utils.EscapeSQL (s)
 Escapes special characters to be used in a SQL query string. More...
 
def pafera.utils.FromShortCode (code, chars='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_')
 Turns a six character alphanumeric code into a 32-bit value. More...
 
def pafera.utils.GetModel (model)
 Returns the model object from the correct module. More...
 
def pafera.utils.KeyFromValue (ls, value)
 Does a reverse lookup to find the key of a value in a dict. More...
 
def pafera.utils.LoadTranslation (g, app, translation, languages)
 Load the translation into the global language dict in g.T. More...
 
def pafera.utils.MakeRBID ()
 Returns a random 64-bit int ID. More...
 
def pafera.utils.MakeRID ()
 Returns a random 32-bit int ID. More...
 
def pafera.utils.ToShortCode (val, chars='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_')
 Turns a 32-bit value into a six character alphanumeric code. More...