diff --git a/django_currentuser/db/models/fields.py b/django_currentuser/db/models/fields.py index f5fdfff..558bfb1 100644 --- a/django_currentuser/db/models/fields.py +++ b/django_currentuser/db/models/fields.py @@ -33,7 +33,7 @@ def __init__(self, *args, **kwargs): if self.on_update: kwargs["editable"] = False kwargs["blank"] = True - + kwargs.update(self.defaults) super(CurrentUserField, self).__init__(**kwargs) diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..9df5c1b --- /dev/null +++ b/setup.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import sys + +import django_currentuser + +from setuptools import setup + +version = django_currentuser.__version__ + +if sys.argv[-1] == 'publish': + os.system('make release') + sys.exit() + +readme = open('README.rst').read() + +description = "Conveniently store reference to request user on thread/db level." + +setup( + name='django-currentuser', + version=version, + description=description, + long_description=readme, + author='Paessler AG', + author_email='bis@paessler.com', + url='https://github.com/PaesslerAG/django-currentuser', + packages=[ + 'django_currentuser', + ], + include_package_data=True, + install_requires=[ + 'Django>=1.11.17,<5.0;python_version>="2.7"', + ], + license="BSD", + zip_safe=False, + keywords='django-currentuser', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Natural Language :: English', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Framework :: Django', + 'Framework :: Django :: 3', + 'Framework :: Django :: 4', + ], +)