forked from DGNum/gestioCOF
Merge branch 'kerl/admin_autocomplete' into 'master'
Admin: on utilise la recherche builtin de Django See merge request klub-dev-ens/gestioCOF!476
This commit is contained in:
commit
5c8eca15b6
1 changed files with 1 additions and 15 deletions
16
bda/admin.py
16
bda/admin.py
|
@ -33,20 +33,6 @@ class ReadOnlyMixin(object):
|
|||
return readonly_fields + self.readonly_fields_update
|
||||
|
||||
|
||||
class ChoixSpectacleAdminForm(forms.ModelForm):
|
||||
class Meta:
|
||||
widgets = {
|
||||
"participant": ModelSelect2(url="bda-participant-autocomplete"),
|
||||
"spectacle": ModelSelect2(url="bda-spectacle-autocomplete"),
|
||||
}
|
||||
|
||||
|
||||
class ChoixSpectacleInline(admin.TabularInline):
|
||||
model = ChoixSpectacle
|
||||
form = ChoixSpectacleAdminForm
|
||||
sortable_field_name = "priority"
|
||||
|
||||
|
||||
class AttributionTabularAdminForm(forms.ModelForm):
|
||||
listing = None
|
||||
|
||||
|
@ -238,7 +224,7 @@ class AttributionAdmin(ReadOnlyMixin, admin.ModelAdmin):
|
|||
|
||||
|
||||
class ChoixSpectacleAdmin(admin.ModelAdmin):
|
||||
form = ChoixSpectacleAdminForm
|
||||
autocomplete_fields = ["participant", "spectacle"]
|
||||
|
||||
def tirage(self, obj):
|
||||
return obj.participant.tirage
|
||||
|
|
Loading…
Reference in a new issue