summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/admin.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2021-03-19 11:23:36 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-03-19 11:23:36 +0100
commitfe8b8f657a4640bdc814651ef11aced916fdc9e3 (patch)
treecc628849cc6a15d19d68f8d0f0d953b1e2e833c0 /archaeological_warehouse/admin.py
parentced270d071384046eb3b9a85572dc817c7ef042c (diff)
downloadIshtar-fe8b8f657a4640bdc814651ef11aced916fdc9e3.tar.bz2
Ishtar-fe8b8f657a4640bdc814651ef11aced916fdc9e3.zip
Format - black: warehouse
Diffstat (limited to 'archaeological_warehouse/admin.py')
-rw-r--r--archaeological_warehouse/admin.py48
1 files changed, 28 insertions, 20 deletions
diff --git a/archaeological_warehouse/admin.py b/archaeological_warehouse/admin.py
index b29c2a8e3..c186950d3 100644
--- a/archaeological_warehouse/admin.py
+++ b/archaeological_warehouse/admin.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
@@ -34,17 +34,19 @@ class DivisionInline(admin.TabularInline):
class WarehouseAdmin(HistorizedObjectAdmin):
- list_display = ('name', 'warehouse_type', 'town')
- list_filter = ('warehouse_type',)
- search_fields = ('name', 'town')
+ list_display = ("name", "warehouse_type", "town")
+ list_filter = ("warehouse_type",)
+ search_fields = ("name", "town")
model = models.Warehouse
ajax_form_dict = HistorizedObjectAdmin.AJAX_FORM_DICT.copy()
- ajax_form_dict.update({
- 'town': 'town',
- 'precise_town': 'town',
- 'person_in_charge': 'person',
- 'organization': 'organization'
- })
+ ajax_form_dict.update(
+ {
+ "town": "town",
+ "precise_town": "town",
+ "person_in_charge": "person",
+ "organization": "organization",
+ }
+ )
form = make_ajax_form(model, ajax_form_dict)
inlines = [DivisionInline]
exclude = ["documents", "main_image"]
@@ -54,8 +56,15 @@ admin_site.register(models.Warehouse, WarehouseAdmin)
class ContainerTypeAdmin(GeneralTypeAdmin):
- LIST_DISPLAY = ('label', 'reference', 'stationary', 'length', 'width',
- 'height', 'volume')
+ LIST_DISPLAY = (
+ "label",
+ "reference",
+ "stationary",
+ "length",
+ "width",
+ "height",
+ "volume",
+ )
model = models.ContainerType
list_filter = ("available", "stationary")
@@ -64,17 +73,16 @@ admin_site.register(models.ContainerType, ContainerTypeAdmin)
class ContainerAdmin(HistorizedObjectAdmin):
- list_display = ('reference', 'location', 'container_type',)
+ list_display = (
+ "reference",
+ "location",
+ "container_type",
+ )
list_filter = ("container_type",)
model = models.Container
- readonly_fields = HistorizedObjectAdmin.readonly_fields + [
- 'history_date'
- ]
+ readonly_fields = HistorizedObjectAdmin.readonly_fields + ["history_date"]
ajax_form_dict = HistorizedObjectAdmin.AJAX_FORM_DICT.copy()
- ajax_form_dict.update({
- 'location': 'warehouse',
- 'responsible': 'warehouse'
- })
+ ajax_form_dict.update({"location": "warehouse", "responsible": "warehouse"})
form = make_ajax_form(model, ajax_form_dict)
exclude = ["documents", "main_image"]