Boilerplate tools for python based projects.
Go to file
László Károlyi 01fef40adc
Use a passable namespace with a default value
2023-10-22 20:19:42 +02:00
src/ktools Use a passable namespace with a default value 2023-10-22 20:19:42 +02:00
.gitignore Initial commit 2023-05-13 19:40:40 +02:00
.isort.cfg Initial commit 2023-05-13 19:40:40 +02:00
LICENSE Initial commit 2023-05-13 19:40:40 +02:00
README.md Add slugify 2023-05-21 20:05:22 +02:00
__init__.py Initial commit 2023-05-13 19:40:40 +02:00
setup.py Adding Jinja helpers 2023-06-27 20:49:11 +02:00

README.md

Ktools

This module contains boilerplate for python projects, mostly based on django.

Contents

Django

ktools.django.db.models.fields.PositiveAutoField

A mysql-based AutoField that will use an UNSIGNED INT for a primary field.

Use this in django's settings.py:

DEFAULT_AUTO_FIELD = 'ktools.django.db.models.fields.PositiveAutoField'

Cache

ktools.cache.functional.memoized_method

A decorator to cache return values of a method (of a class) until the class is used. Parameters are that of lru_cache() since it uses that function under the hood.

ktools.django.utils.text.slugify

Function to return an ASCII-safe slugified string from any utf-8 string.