{ "info": { "author": "Andreas Stocker", "author_email": "andreas@ks.co.at", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=====================\nDjango UserForeignKey\n=====================\n\n.. image:: https://travis-ci.org/beachmachine/django-userforeignkey.svg?branch=master\n :target: https://travis-ci.org/beachmachine/django-userforeignkey\n\n.. image:: https://img.shields.io/pypi/v/django-userforeignkey.svg?maxAge=2592000 :target:\n\nDjango UserForeignKey is a simple Django app that will give you a `UserForeignKey` model field for Django models.\nThis field extends a regular ForeignKey model field, and has the option to automatically set the currently logged in user on\ninsert and/or update.\n\nCurrently, Django 1.11 (Python 2.7, Python 3.4+), Django 2.0 (Python 3.4+) and Django 2.1 (Python 3.5+) are supported.\n\nIf you need support for the insecure and deprecated Django 1.8 (and possibly 1.9 and 1.10), please fall back to version 0.2.1.\n\nThere also is a `video tutorial on YouTube `_ that shows you basic functionality of this package.\n\nQuick start\n-----------\n\n1. Download and install using `pip install`\n\n* either from `PyPi `_\n\n.. code-block:: bash\n\n pip install django-userforeignkey\n\n\n* or directly from this git repo if you prefer the development version from the master branch\n\n.. code-block:: bash\n\n pip install git+https://github.com/beachmachine/django-userforeignkey.git\n\n\n2. Add ``django_userforeignkey`` to your ``INSTALLED_APPS`` setting like this:\n\n.. code-block:: python\n\n INSTALLED_APPS = [\n ...\n 'django_userforeignkey',\n ]\n\n\n3. Add ``django_userforeignkey.middleware.UserForeignKeyMiddleware`` to your ``MIDDLEWARE`` settings like this:\n\n.. code-block:: python\n\n MIDDLEWARE = (\n ...\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n ...\n 'django_userforeignkey.middleware.UserForeignKeyMiddleware',\n )\n\n\nor if you are still using the an older Django version (e.g., Django 1.8) with ``MIDDLEWARE_CLASSES``:\n\n.. code-block:: python\n\n MIDDLEWARE_CLASSES = (\n ...\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n ...\n 'django_userforeignkey.middleware.UserForeignKeyMiddleware',\n )\n\n\nMake sure to insert the ``UserForeignKeyMiddleware`` middleware **after** ``AuthenticationMiddleware``.\n\nExample usage\n-------------\n\nJust add ``UserForeignKey`` to your model like you would with any other foreign key.\n\n\n.. code-block:: python\n\n from django.db import models\n from django_userforeignkey.models.fields import UserForeignKey\n\n class MyModel(models.Model):\n my_data = models.CharField(max_length=64, verbose_name=\"Very important data that are somehow related to a user\")\n user = UserForeignKey(auto_user_add=True, verbose_name=\"The user that is automatically assigned\", related_name=\"mymodels\")\n\n\n\nThe ``UserForeignKey`` behaves just like a normal foreign key to the user model (using ``settings.AUTH_USER_MODEL``), and thus also has properties such as ``related_name``.\n However, whenever an object is created by calling an authenticated view (admin, REST API, ...) which contains a ``request.user`` object,\n the ``request.user`` object is automatically associated.\n\n\nConfiguration options\n---------------------\n\nThe configuration options are similar to Djangos `DateField `_\n\n* ``auto_user`` Automatically sets the current user everytime the object is saved (e.g., created or updated). This is useful for *last modified by* information\n* ``auto_user_add`` Automatically sets the current user when the object is first created. This is useful for *created by* information\n\n\nChangelog\n---------\n\n0.3.0 (Meta release, no actual code changes)\n\n* Dropped support for Django 1.8, 1.9 and 1.10\n* Added support for Django 2.1\n\n0.2.1\n\n* Added ``setup.cfg`` with the ``license_file`` keyword, ensuring that the actual LICENSE file is also installed when using ``pip install``\n* Improved ``.travis.yml``\n\n0.2.0\n\n* Tested for Django 2.0 support\n* Updated test app for Django 2.0 support\n* Updated tox and travis for automated tests with Django 2.0\n* Behaviour change: Prior to 0.2.0 the UserForeignKey field had ``editable`` set to ``False`` only if ``auto_user == True``. Since 0.2.0 ``editable`` is set to ``False`` if ``auto_user == True or auto_user_add == True``\n\n0.1.2\n\n* Initial Release on PyPi\n\n\nDevelopment and Tests\n---------------------\n\n.. code-block:: bash\n\n git clone --recursive https://github.com/beachmachine/django-userforeignkey\n cd django-userforeignkey\n virtualenv -p python2 venv # or virtualenv -p python3\n source venv/bin/activate\n python setup.py install\n pip install Django\n cd tests/user_foreign_key_testapp\n python manage.py test\n\n\nYou can also use `tox` for testing, as it will test against several Django and Python versions automatically. See ``tox.ini`` for details.\n\nThe test source code is in another `repository `_ in the master branch. Changes within that repository can be fetched by calling\n\n.. code-block:: bash\n\n git submodule update --remote\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://ks.co.at/", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "django-userforeignkey", "package_url": "https://pypi.org/project/django-userforeignkey/", "platform": "", "project_url": "https://pypi.org/project/django-userforeignkey/", "project_urls": { "Homepage": "https://ks.co.at/" }, "release_url": "https://pypi.org/project/django-userforeignkey/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "A simple Django app that will give you a UserForeignKey model field.", "version": "0.3.0" }, "last_serial": 4143730, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ecc3c4b9bb519600c0da4d17e65b3142", "sha256": "a29d432e849abfd1a729384b4650953a2a5712717b679bec5c54e086cd35e5b7" }, "downloads": -1, "filename": "django-userforeignkey-0.1.tar.gz", "has_sig": false, "md5_digest": "ecc3c4b9bb519600c0da4d17e65b3142", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4533, "upload_time": "2016-05-25T08:08:52", "url": "https://files.pythonhosted.org/packages/e7/10/af0cbc33535189b457fc4044e127e3f3a03c6677a9320b1f60655fcf8935/django-userforeignkey-0.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3dddf2462922d89d33b97c926101e60b", "sha256": "e40093de8ad9715383ae4cda9391e38286bebb0520fbbdc83d77af7e1f127e0c" }, "downloads": -1, "filename": "django-userforeignkey-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3dddf2462922d89d33b97c926101e60b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5008, "upload_time": "2016-11-16T15:02:44", "url": "https://files.pythonhosted.org/packages/b9/e6/88a4fcf1a8362889f34888be4d8e783768255e903ed806725d7c318eb974/django-userforeignkey-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "27c521e8a06ed828406fc4556b8d0da4", "sha256": "44df355089ee0348735250d8fa252809cd9582175a4d9a30fb7a6e221bf1197e" }, "downloads": -1, "filename": "django-userforeignkey-0.2.0.tar.gz", "has_sig": false, "md5_digest": "27c521e8a06ed828406fc4556b8d0da4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5557, "upload_time": "2017-12-14T08:08:35", "url": "https://files.pythonhosted.org/packages/4d/0f/8e1685ad3f67e3d6f9441f53db56b46ec2fd834c5bb3a43cecd660072436/django-userforeignkey-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b352a17875a9ba441669a0703601523d", "sha256": "d0d990bdc2cac20c2338d5861ee1f8693577a599d26bf58c987422b283fde8bc" }, "downloads": -1, "filename": "django-userforeignkey-0.2.1.tar.gz", "has_sig": false, "md5_digest": "b352a17875a9ba441669a0703601523d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5647, "upload_time": "2018-05-08T12:30:08", "url": "https://files.pythonhosted.org/packages/41/32/cd86db9ddab4c16ca8cf1467354239aacea5a8001f660d385c3152ba03c0/django-userforeignkey-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "c768b7a06c3bb2ae810dc482d31162d3", "sha256": "b5a675f1f09ca9b8c32a174caf7780f524f363c7d1c8ae0d30fdd0ce13268ca6" }, "downloads": -1, "filename": "django-userforeignkey-0.3.0.tar.gz", "has_sig": false, "md5_digest": "c768b7a06c3bb2ae810dc482d31162d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5884, "upload_time": "2018-08-07T11:11:33", "url": "https://files.pythonhosted.org/packages/22/f5/728721c1110e8cf30a9979f28c5f2bbb4c8d8c9d00516bf0ca88bbbd1321/django-userforeignkey-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c768b7a06c3bb2ae810dc482d31162d3", "sha256": "b5a675f1f09ca9b8c32a174caf7780f524f363c7d1c8ae0d30fdd0ce13268ca6" }, "downloads": -1, "filename": "django-userforeignkey-0.3.0.tar.gz", "has_sig": false, "md5_digest": "c768b7a06c3bb2ae810dc482d31162d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5884, "upload_time": "2018-08-07T11:11:33", "url": "https://files.pythonhosted.org/packages/22/f5/728721c1110e8cf30a9979f28c5f2bbb4c8d8c9d00516bf0ca88bbbd1321/django-userforeignkey-0.3.0.tar.gz" } ] }