mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 18:08:38 -06:00
Closes #2131: Added created and last_updated fields to DeviceType
This commit is contained in:
parent
836478c166
commit
8762f1314d
@ -234,7 +234,7 @@ class DeviceTypeSerializer(CustomFieldModelSerializer):
|
|||||||
fields = [
|
fields = [
|
||||||
'id', 'manufacturer', 'model', 'slug', 'part_number', 'u_height', 'is_full_depth', 'interface_ordering',
|
'id', 'manufacturer', 'model', 'slug', 'part_number', 'u_height', 'is_full_depth', 'interface_ordering',
|
||||||
'is_console_server', 'is_pdu', 'is_network_device', 'subdevice_role', 'comments', 'tags', 'custom_fields',
|
'is_console_server', 'is_pdu', 'is_network_device', 'subdevice_role', 'comments', 'tags', 'custom_fields',
|
||||||
'instance_count',
|
'created', 'last_updated', 'instance_count',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,6 +70,8 @@
|
|||||||
"model": "dcim.devicetype",
|
"model": "dcim.devicetype",
|
||||||
"pk": 1,
|
"pk": 1,
|
||||||
"fields": {
|
"fields": {
|
||||||
|
"created": "2016-06-23",
|
||||||
|
"last_updated": "2016-06-23T03:19:56.521Z",
|
||||||
"manufacturer": 1,
|
"manufacturer": 1,
|
||||||
"model": "MX960",
|
"model": "MX960",
|
||||||
"slug": "mx960",
|
"slug": "mx960",
|
||||||
@ -84,6 +86,8 @@
|
|||||||
"model": "dcim.devicetype",
|
"model": "dcim.devicetype",
|
||||||
"pk": 2,
|
"pk": 2,
|
||||||
"fields": {
|
"fields": {
|
||||||
|
"created": "2016-06-23",
|
||||||
|
"last_updated": "2016-06-23T03:19:56.521Z",
|
||||||
"manufacturer": 1,
|
"manufacturer": 1,
|
||||||
"model": "EX9214",
|
"model": "EX9214",
|
||||||
"slug": "ex9214",
|
"slug": "ex9214",
|
||||||
@ -98,6 +102,8 @@
|
|||||||
"model": "dcim.devicetype",
|
"model": "dcim.devicetype",
|
||||||
"pk": 3,
|
"pk": 3,
|
||||||
"fields": {
|
"fields": {
|
||||||
|
"created": "2016-06-23",
|
||||||
|
"last_updated": "2016-06-23T03:19:56.521Z",
|
||||||
"manufacturer": 1,
|
"manufacturer": 1,
|
||||||
"model": "QFX5100-24Q",
|
"model": "QFX5100-24Q",
|
||||||
"slug": "qfx5100-24q",
|
"slug": "qfx5100-24q",
|
||||||
@ -112,6 +118,8 @@
|
|||||||
"model": "dcim.devicetype",
|
"model": "dcim.devicetype",
|
||||||
"pk": 4,
|
"pk": 4,
|
||||||
"fields": {
|
"fields": {
|
||||||
|
"created": "2016-06-23",
|
||||||
|
"last_updated": "2016-06-23T03:19:56.521Z",
|
||||||
"manufacturer": 1,
|
"manufacturer": 1,
|
||||||
"model": "QFX5100-48S",
|
"model": "QFX5100-48S",
|
||||||
"slug": "qfx5100-48s",
|
"slug": "qfx5100-48s",
|
||||||
@ -126,6 +134,8 @@
|
|||||||
"model": "dcim.devicetype",
|
"model": "dcim.devicetype",
|
||||||
"pk": 5,
|
"pk": 5,
|
||||||
"fields": {
|
"fields": {
|
||||||
|
"created": "2016-06-23",
|
||||||
|
"last_updated": "2016-06-23T03:19:56.521Z",
|
||||||
"manufacturer": 2,
|
"manufacturer": 2,
|
||||||
"model": "CM4148",
|
"model": "CM4148",
|
||||||
"slug": "cm4148",
|
"slug": "cm4148",
|
||||||
@ -140,6 +150,8 @@
|
|||||||
"model": "dcim.devicetype",
|
"model": "dcim.devicetype",
|
||||||
"pk": 6,
|
"pk": 6,
|
||||||
"fields": {
|
"fields": {
|
||||||
|
"created": "2016-06-23",
|
||||||
|
"last_updated": "2016-06-23T03:19:56.521Z",
|
||||||
"manufacturer": 3,
|
"manufacturer": 3,
|
||||||
"model": "CWG-24VYM415C9",
|
"model": "CWG-24VYM415C9",
|
||||||
"slug": "cwg-24vym415c9",
|
"slug": "cwg-24vym415c9",
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.11.12 on 2018-05-30 17:30
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.utils.timezone
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('dcim', '0058_relax_rack_naming_constraints'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='devicetype',
|
||||||
|
name='created',
|
||||||
|
field=models.DateField(auto_now_add=True, default=django.utils.timezone.now),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='devicetype',
|
||||||
|
name='last_updated',
|
||||||
|
field=models.DateTimeField(auto_now=True),
|
||||||
|
),
|
||||||
|
]
|
@ -682,7 +682,7 @@ class Manufacturer(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class DeviceType(models.Model, CustomFieldModel):
|
class DeviceType(CreatedUpdatedModel, CustomFieldModel):
|
||||||
"""
|
"""
|
||||||
A DeviceType represents a particular make (Manufacturer) and model of device. It specifies rack height and depth, as
|
A DeviceType represents a particular make (Manufacturer) and model of device. It specifies rack height and depth, as
|
||||||
well as high-level functional role(s).
|
well as high-level functional role(s).
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if perms.dcim.change_devicetype or perms.dcim.delete_devicetype %}
|
{% if perms.dcim.change_devicetype or perms.dcim.delete_devicetype %}
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
{% if perms.dcim.change_devicetype %}
|
{% if perms.dcim.change_devicetype %}
|
||||||
@ -28,8 +27,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h1>{% block title %}{{ devicetype.manufacturer }} {{ devicetype.model }}{% endblock %}</h1>
|
<h1>{% block title %}{{ devicetype.manufacturer }} {{ devicetype.model }}{% endblock %}</h1>
|
||||||
|
{% include 'inc/created_updated.html' with obj=devicetype %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
Loading…
Reference in New Issue
Block a user