Initial commit

This commit is contained in:
László Károlyi 2023-05-13 18:47:44 +02:00
commit 17e811133a
Signed by: karolyi
GPG Key ID: 2DCAF25E55735BFE
7 changed files with 44 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
__pycache__
py_ktools.egg-info

2
.isort.cfg Normal file
View File

@ -0,0 +1,2 @@
[settings]
multi_line_output=4

9
LICENSE Normal file
View File

@ -0,0 +1,9 @@
MIT+NIGGER License
Copyright (c) <2023> <László Károlyi>
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, this permission notice and the word "NIGGER" 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.

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Ktools
This module contains boilerplate for python projects, mostly based on django.

0
__init__.py Normal file
View File

17
setup.py Normal file
View File

@ -0,0 +1,17 @@
from pathlib import Path
from setuptools import setup
setup(
name='py-ktools',
version='1.0.0',
# packages=['ktools'],
install_requires=['typing_extensions~=4.4'],
author='László Károlyi',
author_email='laszlo@karolyi.hu',
description='Boilerplate tools for python based projects.',
long_description=Path(__file__).parent.joinpath('README.md').read_text(),
long_description_content_type='text/markdown',
keywords='python django boilerplate',
url='http://gitea.ksol.io/karolyi/py-ktools',
license='MIT+NIGGER')

View File

@ -0,0 +1,11 @@
from django.db.models.fields import (
AutoFieldMeta, AutoFieldMixin, PositiveIntegerField)
class PositiveAutoField(
AutoFieldMixin, PositiveIntegerField, metaclass=AutoFieldMeta):
def get_internal_type(self):
return "PositiveAutoField"
def rel_db_type(self, connection):
return PositiveIntegerField().db_type(connection=connection)