Utils
inyoka.utils
Various application independent utilities.
- copyright:
2007-2024 by the Inyoka Team, see AUTHORS for more details.
- license:
BSD, see LICENSE for more details.
- class inyoka.utils.classproperty(func, name=None)
A mix out of the built-in classmethod and property so that we can achieve a property that is not bound to an instance.
Example:
>>> class Foo(object): ... bar = 'baz' ... ... @classproperty ... def bars(cls): ... return [cls.bar] ... >>> Foo.bars ['baz']
- inyoka.utils.ctype(model)
- inyoka.utils.get_request_context(request)
- inyoka.utils.get_significant_digits(value, lower, upper)
Get the significant digits of value which are constrained by the (inclusive) lower and upper bounds.
If there are no significant digits which are definitely within the bounds, exactly one significant digit will be returned in the result.
>>> get_significant_digits(15, 15, 15) 15 >>> get_significant_digits(4777, 208, 6000) 5000 >>> get_significant_digits(9, 9, 100) 9
- inyoka.utils.groupby(input, keyfunc)
References
- Utils Cache
- Utils Captcha
- Utils Database
- Utils Dates
- Utils Decorators
- Utils Diff3
- Utils Feeds
- Utils Files
- Utils Flash_Confirmation
- Utils Forms
- Utils Generic
- Utils Gravatar
- Utils Highlight
- Utils Html
- Utils Http
- Utils Imaging
- Utils Local
- Utils Logger
- Utils Mail
- Utils Notification
- Utils Pagination
- Utils Services
- Utils Sessions
- Utils Signals
- Utils Sortable
- Utils Storage
- Utils Templating
- Utils Terminal
- Utils Test
- Utils Text
- Utils Timer
- Utils Urls
- Utils User