From 3275de7c9c00cf7e282543a54727dedd3ac21318 Mon Sep 17 00:00:00 2001 From: Qwann Date: Mon, 27 Aug 2018 15:31:44 +0200 Subject: [PATCH] hotfix: dates activity --- equipment/admin.py | 4 ++++ event/admin.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/equipment/admin.py b/equipment/admin.py index 215f918..dd10e04 100644 --- a/equipment/admin.py +++ b/equipment/admin.py @@ -11,6 +11,8 @@ class IdForm(forms.ModelForm): kwargs.pop('min_value') if 'num_choices' in kwargs: num_choices = kwargs.pop('num_choices') + else: + num_choices = None super(IdForm, self).__init__(*args, **kwargs) for field in self.instance._meta.fields: @@ -65,6 +67,7 @@ class CategoryAdmin(admin.ModelAdmin): list_display = ['name', 'parent', "full_name_p"] ordering = ['name', 'parent'] search_fields = ['name',] + autocomplete_fields = ['parent', ] class EquipmentAttributeAdmin(admin.ModelAdmin): @@ -76,6 +79,7 @@ class EquipmentAttributeAdmin(admin.ModelAdmin): class EquipmentAdmin(admin.ModelAdmin): save_as_continue = True save_on_top = True + autocomplete_fields = ['category', ] readonly_fields = ['full_category_p', 'added_at', 'modified_at', diff --git a/event/admin.py b/event/admin.py index 51cdabf..b68f328 100644 --- a/event/admin.py +++ b/event/admin.py @@ -63,7 +63,7 @@ class ActivityTemplateAdmin(admin.ModelAdmin): class ActivityAdmin(admin.ModelAdmin): - save_as_continue = True + save_as = True save_on_top = True list_display = ['title', 'event', 'is_public', 'parent', ] ordering = ['title', 'event', 'has_perm', 'parent', ] @@ -73,12 +73,12 @@ class ActivityAdmin(admin.ModelAdmin): inlines = [EquipmentAttributionExtraInline, ] fieldsets = ( ('Général', { - 'fields': ('event', 'parent', 'title', 'is_public', ('beginning', 'end', ), 'places', ), + 'fields': ('event', 'parent', 'title', 'is_public', 'beginning', 'end', 'places', ), 'description': "Tous ces champs sont héritables (sauf parent et Évènement)", }), ('Permanences', { 'fields': ('has_perm', ('min_perm', 'max_perm', ), 'staff', ), - 'classes': ('collapse',), + 'classes': ('wide',), 'description': "Tous ces champs sont héritables (sauf les gens en perm)", }), ('Descriptions', {