Skip to content
Extraits de code Groupes Projets
Valider 22519fc3 rédigé par Jamesie Pic's avatar Jamesie Pic
Parcourir les fichiers

Added autocompletes for dossier

parent c0c4d714
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -65,6 +65,7 @@ ORGANIZATION_NAME = os.environ.get('ORGANIZATION', 'Memopol Demo')
INSTALLED_APPS = (
# 'django.contrib.admin',
'autocomplete_light',
# Instead of contrib.admin to use Django-Admin-Plus
'django.contrib.admin.apps.SimpleAdminConfig',
'django.contrib.auth',
......
......@@ -34,5 +34,6 @@ urlpatterns = patterns('',
url(r'^legislature/', include('legislature.urls', namespace='legislature')),
url(r'^votes/', include('votes.urls', namespace='votes')),
url(r'^positions/', include('positions.urls', namespace='positions')),
url(r'^autocomplete/', include('autocomplete_light.urls')),
url(r'^admin/', include(admin.site.urls)),
)
......@@ -22,3 +22,4 @@ django-extensions
django-debug-toolbar
redis
djangorestframework
django-autocomplete-light
# coding: utf-8
# This file is part of memopol.
#
# memopol is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or any later version.
#
# memopol is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU General Affero Public
# License along with django-representatives.
# If not, see <http://www.gnu.org/licenses/>.
#
# Copyright (C) 2015 Arnaud Fabre <af@laquadrature.net>
from __future__ import absolute_import
from autocomplete_light import shortcuts as ac
from django.contrib import admin
from django.core.urlresolvers import reverse
......@@ -54,13 +37,13 @@ class MemopolDossierAdmin(admin.ModelAdmin):
class RecommendationsAdmin(admin.ModelAdmin):
def link_to_proposal(self):
return link_to_edit(self, 'proposal')
link_to_proposal.allow_tags = True
list_display = ('id', 'title', link_to_proposal, 'recommendation','weight')
search_fields = ('title', 'recommendation', 'proposal')
form = ac.modelform_factory(Recommendation, exclude=[])
admin.site.register(MemopolDossier, MemopolDossierAdmin)
admin.site.register(Recommendation, RecommendationsAdmin)
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter