from django.contrib import admin

from .models import Device, LoginLog

class DeviceAdmin(admin.ModelAdmin):
    list_display = ['user', 'device_model', 'last_login', 'id']
    readonly_fields = ('last_login',)
    ordering = ['-last_login']

class LoginLogAdmin(admin.ModelAdmin):
    list_display = ['user', 'device', 'date']
    ordering = ['-date']

admin.site.register(Device, DeviceAdmin)
admin.site.register(LoginLog, LoginLogAdmin)
