mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-21 11:37:21 -06:00
DataFile should not inherit from ChangeLoggingMixin
This commit is contained in:
parent
62509c20da
commit
a1c9f7a2c6
@ -43,9 +43,9 @@ class Migration(migrations.Migration):
|
|||||||
name='DataFile',
|
name='DataFile',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
||||||
('created', models.DateTimeField(auto_now_add=True, null=True)),
|
('created', models.DateTimeField(auto_now_add=True)),
|
||||||
('path', models.CharField(editable=False, max_length=1000)),
|
|
||||||
('last_updated', models.DateTimeField(editable=False)),
|
('last_updated', models.DateTimeField(editable=False)),
|
||||||
|
('path', models.CharField(editable=False, max_length=1000)),
|
||||||
('size', models.PositiveIntegerField(editable=False)),
|
('size', models.PositiveIntegerField(editable=False)),
|
||||||
('hash', models.CharField(editable=False, max_length=64, validators=[django.core.validators.RegexValidator(message='Length must be 64 hexadecimal characters.', regex='^[0-9a-f]{64}$')])),
|
('hash', models.CharField(editable=False, max_length=64, validators=[django.core.validators.RegexValidator(message='Length must be 64 hexadecimal characters.', regex='^[0-9a-f]{64}$')])),
|
||||||
('data', models.BinaryField()),
|
('data', models.BinaryField()),
|
||||||
|
@ -228,11 +228,17 @@ class DataSource(PrimaryModel):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class DataFile(ChangeLoggingMixin, models.Model):
|
class DataFile(models.Model):
|
||||||
"""
|
"""
|
||||||
The database representation of a remote file fetched from a remote DataSource. DataFile instances should be created,
|
The database representation of a remote file fetched from a remote DataSource. DataFile instances should be created,
|
||||||
updated, or deleted only by calling DataSource.sync().
|
updated, or deleted only by calling DataSource.sync().
|
||||||
"""
|
"""
|
||||||
|
created = models.DateTimeField(
|
||||||
|
auto_now_add=True
|
||||||
|
)
|
||||||
|
last_updated = models.DateTimeField(
|
||||||
|
editable=False
|
||||||
|
)
|
||||||
source = models.ForeignKey(
|
source = models.ForeignKey(
|
||||||
to='core.DataSource',
|
to='core.DataSource',
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
@ -244,9 +250,6 @@ class DataFile(ChangeLoggingMixin, models.Model):
|
|||||||
editable=False,
|
editable=False,
|
||||||
help_text=_("File path relative to the data source's root")
|
help_text=_("File path relative to the data source's root")
|
||||||
)
|
)
|
||||||
last_updated = models.DateTimeField(
|
|
||||||
editable=False
|
|
||||||
)
|
|
||||||
size = models.PositiveIntegerField(
|
size = models.PositiveIntegerField(
|
||||||
editable=False
|
editable=False
|
||||||
)
|
)
|
||||||
|
@ -50,7 +50,6 @@ class DataSourceTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|||||||
|
|
||||||
class DataFileTestCase(
|
class DataFileTestCase(
|
||||||
ViewTestCases.GetObjectViewTestCase,
|
ViewTestCases.GetObjectViewTestCase,
|
||||||
ViewTestCases.GetObjectChangelogViewTestCase,
|
|
||||||
ViewTestCases.DeleteObjectViewTestCase,
|
ViewTestCases.DeleteObjectViewTestCase,
|
||||||
ViewTestCases.ListObjectsViewTestCase,
|
ViewTestCases.ListObjectsViewTestCase,
|
||||||
ViewTestCases.BulkDeleteObjectsViewTestCase,
|
ViewTestCases.BulkDeleteObjectsViewTestCase,
|
||||||
|
Loading…
Reference in New Issue
Block a user