diff --git a/vehicles/admin.py b/vehicles/admin.py index 4285855..02e58d0 100644 --- a/vehicles/admin.py +++ b/vehicles/admin.py @@ -4,8 +4,8 @@ from vehicles.models import * class _vhc_admin(admin.ModelAdmin): - list_display = ('sName', 'nBases', 'nStatus') - + list_display = ('sName', 'nBases', 'nStatus', "bLucas") + ordering = ["nOrder"] search_fields = ['sName'] diff --git a/vehicles/models.py b/vehicles/models.py index ec95cf6..aa0b24f 100644 --- a/vehicles/models.py +++ b/vehicles/models.py @@ -10,9 +10,9 @@ BASES_CHOICES = [ ] STATUS_CHOICES = [ ('1', 'Opérationnel'), - ('2', 'Hors Service'), - ('3', 'Réserve'), - ('4', 'Utilisation altérée'), + ('2', 'Réserve'), + ('3', 'Utilisation altérée'), + ('4', 'Hors Service'), ] TYPES_CHOICES = [ ('1', 'Technique'), @@ -25,6 +25,8 @@ class Vehicles(models.Model): sName = models.CharField("Indicatif", max_length=250) nBases = models.CharField('Basé à ', max_length=1, choices=BASES_CHOICES, default=1) nStatus = models.CharField('Statut', max_length=1, choices=STATUS_CHOICES, default=1) + bLucas = models.BooleanField("Lucas", default=0) + nOrder = models.IntegerField("Ordre", default=0) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/vehicles/static/vehicles/images/ocvs_rtw_2.png b/vehicles/static/vehicles/images/ocvs_rtw_2.png index eee22a9..91d9a45 100644 Binary files a/vehicles/static/vehicles/images/ocvs_rtw_2.png and b/vehicles/static/vehicles/images/ocvs_rtw_2.png differ diff --git a/vehicles/static/vehicles/images/ocvs_rtw_3.png b/vehicles/static/vehicles/images/ocvs_rtw_3.png index 91d9a45..2bb002c 100644 Binary files a/vehicles/static/vehicles/images/ocvs_rtw_3.png and b/vehicles/static/vehicles/images/ocvs_rtw_3.png differ diff --git a/vehicles/static/vehicles/images/ocvs_rtw_4.png b/vehicles/static/vehicles/images/ocvs_rtw_4.png index 2bb002c..eee22a9 100644 Binary files a/vehicles/static/vehicles/images/ocvs_rtw_4.png and b/vehicles/static/vehicles/images/ocvs_rtw_4.png differ diff --git a/vehicles/templates/vhc/vhc.html b/vehicles/templates/vhc/vhc.html index fd1cff7..f6411ad 100644 --- a/vehicles/templates/vhc/vhc.html +++ b/vehicles/templates/vhc/vhc.html @@ -12,10 +12,12 @@ {% with 'vehicles/images/ocvs_rtw_'|add:vhc.nStatus|add:'.png' as image_static %}
- {{vhc.sName}}
+ {{vhc.sName}}

+ {% if vhc.bLucas %} Lucas + {% endif %}
diff --git a/vehicles/views.py b/vehicles/views.py index a125635..d50abb9 100644 --- a/vehicles/views.py +++ b/vehicles/views.py @@ -10,7 +10,7 @@ from vehicles.models import * @xframe_options_exempt def view_vhc(request): template = loader.get_template("vhc/vhc.html") - a_vhc = Vehicles.objects.all() + a_vhc = Vehicles.objects.all().order_by("nStatus","nOrder") context = {'list_vhc': a_vhc} print("passs 1 ligne 12")