Test refont grahpique véhicules
This commit is contained in:
@@ -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']
|
||||
|
@@ -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)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 452 KiB After Width: | Height: | Size: 507 KiB |
Binary file not shown.
Before Width: | Height: | Size: 507 KiB After Width: | Height: | Size: 478 KiB |
Binary file not shown.
Before Width: | Height: | Size: 478 KiB After Width: | Height: | Size: 452 KiB |
@@ -12,10 +12,12 @@
|
||||
{% with 'vehicles/images/ocvs_rtw_'|add:vhc.nStatus|add:'.png' as image_static %}
|
||||
<div class="child">
|
||||
<div style="height: 25%;display: flex;" >
|
||||
<b>{{vhc.sName}}</b><br>
|
||||
<a href="/admin/vehicles/vehicles/{{vhc.id}}/change/" target="_blank" style="font-weight: bold;">{{vhc.sName}}</a><br>
|
||||
|
||||
<img height="100px" src="{% static image_static %}" ><br>
|
||||
{% if vhc.bLucas %}
|
||||
<span style="align-self: flex-end; padding: 20px;">Lucas</span>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div class="child_box" style="height: 70%;">
|
||||
|
@@ -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")
|
||||
|
||||
|
Reference in New Issue
Block a user