hotfix: dates activity

This commit is contained in:
Qwann 2018-08-27 15:31:44 +02:00
parent dd47cc3b07
commit 3275de7c9c
2 changed files with 7 additions and 3 deletions

View file

@ -11,6 +11,8 @@ class IdForm(forms.ModelForm):
kwargs.pop('min_value') kwargs.pop('min_value')
if 'num_choices' in kwargs: if 'num_choices' in kwargs:
num_choices = kwargs.pop('num_choices') num_choices = kwargs.pop('num_choices')
else:
num_choices = None
super(IdForm, self).__init__(*args, **kwargs) super(IdForm, self).__init__(*args, **kwargs)
for field in self.instance._meta.fields: for field in self.instance._meta.fields:
@ -65,6 +67,7 @@ class CategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'parent', "full_name_p"] list_display = ['name', 'parent', "full_name_p"]
ordering = ['name', 'parent'] ordering = ['name', 'parent']
search_fields = ['name',] search_fields = ['name',]
autocomplete_fields = ['parent', ]
class EquipmentAttributeAdmin(admin.ModelAdmin): class EquipmentAttributeAdmin(admin.ModelAdmin):
@ -76,6 +79,7 @@ class EquipmentAttributeAdmin(admin.ModelAdmin):
class EquipmentAdmin(admin.ModelAdmin): class EquipmentAdmin(admin.ModelAdmin):
save_as_continue = True save_as_continue = True
save_on_top = True save_on_top = True
autocomplete_fields = ['category', ]
readonly_fields = ['full_category_p', readonly_fields = ['full_category_p',
'added_at', 'added_at',
'modified_at', 'modified_at',

View file

@ -63,7 +63,7 @@ class ActivityTemplateAdmin(admin.ModelAdmin):
class ActivityAdmin(admin.ModelAdmin): class ActivityAdmin(admin.ModelAdmin):
save_as_continue = True save_as = True
save_on_top = True save_on_top = True
list_display = ['title', 'event', 'is_public', 'parent', ] list_display = ['title', 'event', 'is_public', 'parent', ]
ordering = ['title', 'event', 'has_perm', 'parent', ] ordering = ['title', 'event', 'has_perm', 'parent', ]
@ -73,12 +73,12 @@ class ActivityAdmin(admin.ModelAdmin):
inlines = [EquipmentAttributionExtraInline, ] inlines = [EquipmentAttributionExtraInline, ]
fieldsets = ( fieldsets = (
('Général', { ('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)", 'description': "Tous ces champs sont héritables (sauf parent et Évènement)",
}), }),
('Permanences', { ('Permanences', {
'fields': ('has_perm', ('min_perm', 'max_perm', ), 'staff', ), 'fields': ('has_perm', ('min_perm', 'max_perm', ), 'staff', ),
'classes': ('collapse',), 'classes': ('wide',),
'description': "Tous ces champs sont héritables (sauf les gens en perm)", 'description': "Tous ces champs sont héritables (sauf les gens en perm)",
}), }),
('Descriptions', { ('Descriptions', {