Sets default value for district corporation field

This commit is contained in:
Claude Paroz 2018-06-08 15:31:20 +02:00
parent 02fb84700f
commit ec4a3592ff
2 changed files with 37 additions and 3 deletions

View file

@ -215,13 +215,21 @@ class ContactInline(admin.StackedInline):
class CorporationAdmin(admin.ModelAdmin):
list_display = ('name', 'short_name', 'pcode', 'city', 'ext_id')
list_display = ('name', 'short_name', 'pcode', 'city', 'district', 'ext_id')
list_editable = ('short_name',) # Temporarily?
list_filter = (('archived', ArchivedListFilter),)
search_fields = ('name', 'street', 'pcode', 'city')
ordering = ('name',)
fields = (('name', 'short_name'), 'parent', ('sector', 'typ', 'ext_id'),
'street', ('pcode', 'city'), ('tel', 'email'), 'web', 'archived')
fields = (
('name', 'short_name'),
'parent',
('sector', 'typ', 'ext_id'),
'street',
('pcode', 'city', 'district'),
('tel', 'email'),
'web',
'archived',
)
inlines = [ContactInline]
def get_search_results(self, request, qs, term):