Модель для хранения иконок
This commit is contained in:
parent
6e71748c2d
commit
82853de7fd
@ -1,6 +1,7 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models.model_equipment import Equipment
|
||||
from .models.model_type_icons import ModelTypeIcons
|
||||
from .models.model_type_sensor import TypeSensor
|
||||
from .models.model_sensors import Sensors
|
||||
from .models.model_indicators import Indicators
|
||||
@ -40,4 +41,9 @@ class GtoAlarmAdmin(admin.ModelAdmin):
|
||||
@admin.register(EquipmentTracking)
|
||||
class EquipmentTrackingAdmin(admin.ModelAdmin):
|
||||
ordering = ('eventid',)
|
||||
list_display = ('eventid','equipment','time','lat','lon','speed')
|
||||
list_display = ('eventid','equipment','time','lat','lon','speed')
|
||||
|
||||
|
||||
@admin.register(ModelTypeIcons)
|
||||
class ModelTypeIconsAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
25
apps/gto/migrations/0013_modeltypeicons.py
Normal file
25
apps/gto/migrations/0013_modeltypeicons.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Generated by Django 3.2.25 on 2025-01-21 04:26
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gto', '0012_alter_equipmenttracking_eventid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ModelTypeIcons',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('model', models.CharField(max_length=128)),
|
||||
('path', models.CharField(max_length=256)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Иконка оборудования',
|
||||
'verbose_name_plural': 'Иконки оборудования',
|
||||
},
|
||||
),
|
||||
]
|
||||
13
apps/gto/models/model_type_icons.py
Normal file
13
apps/gto/models/model_type_icons.py
Normal file
@ -0,0 +1,13 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class ModelTypeIcons(models.Model):
|
||||
model = models.CharField(max_length=128)
|
||||
path = models.CharField(max_length=256)
|
||||
|
||||
def __str__(self):
|
||||
return self.model
|
||||
|
||||
class Meta: # отображение в админики
|
||||
verbose_name = u'Иконка оборудования'
|
||||
verbose_name_plural = u'Иконки оборудования'
|
||||
Loading…
x
Reference in New Issue
Block a user