django应用程序允许you-yout通用关系有一个很好的管理小部件
django-genericforeignke的Python项目详细描述
内容
Generic Foreign Key
Information
generic foreign key是一个django应用程序,它允许您的泛型关系在管理中有一个很好的小部件
它是根据GNU小公众的条款分发的 许可证<;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
添加“排除内容类型”设置,其中包含要排除的内容类型。此步骤不是必需的,但建议执行
EXCLUDE_CONTENT_TYPES = (('auth', 'group'), ('auth', 'messege'), ...)
您也可以使用此设置进行筛选
FILTER_CONTENT_TYPES = (('auth', 'group'), ('auth', 'messege'), ...)
如果您希望用户界面更友好地选择一个内容
SEARCH_MODELADMIN = True
并且在change_list.html中覆盖ExtraStyle块:
{% 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 %}
0.60.4
- 西班牙语翻译