forked from DGNum/gestioCOF
Admin: on utilise la recherche builtin de Django
This commit is contained in:
parent
479e751b7c
commit
49fde85187
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
|
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):
|
class AttributionTabularAdminForm(forms.ModelForm):
|
||||||
listing = None
|
listing = None
|
||||||
|
|
||||||
|
@ -238,7 +224,7 @@ class AttributionAdmin(ReadOnlyMixin, admin.ModelAdmin):
|
||||||
|
|
||||||
|
|
||||||
class ChoixSpectacleAdmin(admin.ModelAdmin):
|
class ChoixSpectacleAdmin(admin.ModelAdmin):
|
||||||
form = ChoixSpectacleAdminForm
|
autocomplete_fields = ["participant", "spectacle"]
|
||||||
|
|
||||||
def tirage(self, obj):
|
def tirage(self, obj):
|
||||||
return obj.participant.tirage
|
return obj.participant.tirage
|
||||||
|
|
Loading…
Reference in a new issue