Remove dependencies of an old version of dal

Django-autocomplete-light does not support the `modelform_factory`
anymore in recent versions. We are actually using an old version of dal
because of this.

This had to be dropped at some point… So now is a good time
This commit is contained in:
Martin Pépin 2017-02-22 19:26:37 +01:00
parent e1bab7e4ed
commit 8b905f66dc
6 changed files with 2 additions and 40 deletions

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import autocomplete_light
from datetime import timedelta
from custommail.shortcuts import send_mass_custom_mail
@ -119,8 +118,6 @@ class AttributionAdmin(admin.ModelAdmin):
class ChoixSpectacleAdmin(admin.ModelAdmin):
form = autocomplete_light.modelform_factory(ChoixSpectacle, exclude=[])
def tirage(self, obj):
return obj.participant.tirage
list_display = ("participant", "tirage", "spectacle", "priority",

View file

@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import autocomplete_light
from bda.models import Participant, Spectacle
autocomplete_light.register(
Participant, search_fields=('user__username', 'user__first_name',
'user__last_name'),
autocomplete_js_attributes={'placeholder': 'participant...'})
autocomplete_light.register(
Spectacle, search_fields=('title', ),
autocomplete_js_attributes={'placeholder': 'spectacle...'})

View file

@ -6,8 +6,6 @@ from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
import django.utils.six as six
import autocomplete_light
from .petits_cours_models import PetitCoursDemande, \
PetitCoursSubject, PetitCoursAbility, PetitCoursAttribution, \
PetitCoursAttributionCounter
@ -95,7 +93,6 @@ class EventAdmin(admin.ModelAdmin):
class EventRegistrationAdmin(admin.ModelAdmin):
form = autocomplete_light.modelform_factory(EventRegistration, exclude=[])
list_display = ('__unicode__' if six.PY2 else '__str__', 'event', 'user',
'paid')
list_filter = ('paid',)

View file

@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
import autocomplete_light
from django.contrib.auth.models import User
autocomplete_light.register(
User, search_fields=('username', 'first_name', 'last_name'),
attrs={'placeholder': 'membre...'}
)

View file

@ -47,9 +47,8 @@ events_patterns = [
]
calendar_patterns = [
url(r'^subscription$', 'cof.views.calendar'),
url(r'^(?P<token>[a-z0-9-]+)/calendar.ics$',
'cof.views.calendar_ics')
url(r'^subscription$', views.calendar),
url(r'^(?P<token>[a-z0-9-]+)/calendar.ics$', views.calendar_ics)
]
clubs_patterns = [

View file

@ -4,8 +4,6 @@
Fichier principal de configuration des urls du projet GestioCOF
"""
import autocomplete_light
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
@ -20,7 +18,6 @@ from cof.autocomplete import autocomplete
from gestion import views as gestion_views
autocomplete_light.autodiscover()
admin.autodiscover()
urlpatterns = [