Generic Foreign Key
Information
Generic Foreign Key is a Django application that allows your Generic relations have a nice widget in the admin
It is distrubuted under the terms of the GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl.html>
Dependencies
<script src="/media/js/jquery-1.2.6.min.js"></script>
Installation
Install in your base_site.html of django admin
<script src-"/media/js/jquery-1.2.6.min.js"></script>
In your settings.py
Add a setting EXCLUDE_CONTENT_TYPES, with the content types to exclude. This step is not necesary, but advisable
EXCLUDE_CONTENT_TYPES = (('auth', 'group'), ('auth', 'messege'), ...)
You can filter too, with this setting
FILTER_CONTENT_TYPES = (('auth', 'group'), ('auth', 'messege'), ...)
If you want to a UI more friendly to select a the content
SEARCH_MODELADMIN = True
And in your change_list.html overwrite extrastyle block:
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/changelists.css" />
{% if cl.formset %}
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />
{% url admin:jsi18n as jsi18nurl %}
<script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
{% endif %}
{{ media }}
{% if not actions_on_top and not actions_on_bottom %}
<style>
#changelist table thead th:first-child {width: inherit}
</style>
{% endif %}
{{ generic_fk_media }}
{% endblock %}
In your ModelAdmin
Extend yout ModelAdmin with GenericAdmin
class MyModelAdmin(GenericAdmin):
...
0.60.4
Spanish translations
Metadata
Release files for django-genericforeignkey 0.60.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-genericforeignkey-0.60.4.tar.gz | 14.1 kB | Without provenance | Details |
Release files / django-genericforeignkey-0.60.4.tar.gz
| Download URL | django-genericforeignkey-0.60.4.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1a1075c0fc5642096698ec09d4f618ab2bf852ea67f0fa34e608131fed9810f
|
|
BLAKE2b-256 checksum How to use checksums |
2668f217a943375242f89cd738057688c174533bf0d6ce38ef6571c2f2e311d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-genericforeignkey 0.60.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.