Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
8d68889e
Commit
8d68889e
authored
Feb 09, 2016
by
Jamesie Pic
Browse files
Added proposal autocomplete, upgrade to DAL v3
parent
8eac5f5b
Changes
6
Hide whitespace changes
Inline
Side-by-side
memopol/settings.py
View file @
8d68889e
...
...
@@ -69,7 +69,8 @@ ORGANIZATION_NAME = os.environ.get('ORGANIZATION', 'Memopol Demo')
INSTALLED_APPS
=
(
# 'django.contrib.admin',
'autocomplete_light'
,
'dal'
,
'dal_select2'
,
'suit'
,
'django.contrib.admin'
,
'django.contrib.auth'
,
...
...
memopol/urls.py
View file @
8d68889e
...
...
@@ -27,7 +27,6 @@ urlpatterns = [
views
.
DossierList
.
as_view
(),
),
url
(
r
'^autocomplete/'
,
include
(
'autocomplete_light.urls'
)),
url
(
r
'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r
'legislature/'
,
include
(
'representatives.urls'
,
namespace
=
'representatives'
)),
...
...
representatives_recommendations/admin.py
View file @
8d68889e
...
...
@@ -3,12 +3,13 @@ from __future__ import absolute_import
from
django.contrib
import
admin
from
.forms
import
RecommendationForm
from
.models
import
Recommendation
class
RecommendationsAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'id'
,
'title'
,
'proposal'
,
'recommendation'
,
'weight'
)
search_fields
=
(
'title'
,
'recommendation'
,
'proposal'
)
raw_id_fields
=
(
'proposal'
,)
form
=
RecommendationForm
admin
.
site
.
register
(
Recommendation
,
RecommendationsAdmin
)
representatives_recommendations/forms.py
0 → 100644
View file @
8d68889e
from
dal
import
autocomplete
from
django
import
forms
from
models
import
Recommendation
class
RecommendationForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Recommendation
fields
=
'__all__'
widgets
=
{
'proposal'
:
autocomplete
.
ModelSelect2
(
url
=
'representatives_votes:proposal-autocomplete'
,
)
}
setup.py
View file @
8d68889e
...
...
@@ -9,13 +9,13 @@ setup(name='political-memory',
author_email
=
'cortex@worlddomination.be'
,
url
=
'http://github.com/political-memory/political_memory/'
,
install_requires
=
[
'django-autocomplete-light>=
2.2,<
3.0'
,
'django-autocomplete-light>=3.0'
,
'django-bootstrap3>=6.2,<6.3'
,
'django-coffeescript>=0.7,<0.8'
,
'django-compressor>=1.6,<1.7'
,
'django-datetime-widget>=0.9,<1.0'
,
'django-filter>=0.11,<0.12'
,
'django-representatives-votes>=0.0.1
2
'
,
'django-representatives-votes>=0.0.1
3
'
,
'django-representatives>=0.0.14'
,
'django-taggit>=0.17,<0.18'
,
'django>=1.8,<1.9'
,
...
...
templates/admin/base_site.html
deleted
100644 → 0
View file @
8eac5f5b
{% extends "admin/base.html" %}
{% load static %}
{% block extrahead %}
<script
type=
"text/javascript"
src=
"{% static 'libs/jquery/dist/jquery.js' %}"
></script>
{% include 'autocomplete_light/static.html' %}
{% endblock %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment