from django.contrib import admin

from vehicles.models import *

class _vhc_admin(admin.ModelAdmin):

    list_display = ('sName', 'nBases', 'nStatus', "bLucas")
    ordering = ["nOrder"]


    search_fields = ['sName']


    #fields = ["sBases", "dtDate",'type', "user","nHour", "nMinutes", "sRemarques"]
    fieldsets = (
        ('Informations liées au véhicule', {
            'fields': ('sName', "nBases")
        }),
        ('Statut et équipement', {
            'fields': ('nStatus', 'bLucas')
        }),
        ('Informations diverses', {
            'classes': ('collapse', 'close'),
            'fields': ("nOrder", "nType")
        }),
    )

class _vhc_infos_admin(admin.ModelAdmin):

    list_display = ('Vehicle', 'nType', 'sDesc')



    search_fields = ['Vehicle']


    #fields = ["Vehicle", "nType",'sTitle', "sDesc","dtStart", "dtEnd", "Author"]
    fieldsets = (
        ('Informations liées au véhicule', {
            'fields': ('Vehicle',)
        }),
        ('Information sur le message', {
            'fields': ('nType','sDesc')
        }),
        ('Information supplémentaires et validité', {
            'fields': ("dtStart","dtEnd", 'Author', "bEnabled")
        }),
    )



admin.site.register(Vehicles_infos, _vhc_infos_admin)
admin.site.register(Vehicles, _vhc_admin)
