mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
12237 update to Django 4.2 / psycopg3 (#12916)
* 12237 upgrade django and psycopg * 12237 add migration * 12237 rename migration * 12237 update requirements * 12237 fix migration * Update base requirements --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
@@ -290,8 +290,10 @@ class DataFile(models.Model):
|
||||
|
||||
@property
|
||||
def data_as_string(self):
|
||||
if not self.data:
|
||||
return None
|
||||
try:
|
||||
return self.data.tobytes().decode('utf-8')
|
||||
return bytes(self.data, 'utf-8')
|
||||
except UnicodeDecodeError:
|
||||
return None
|
||||
|
||||
|
17
netbox/extras/migrations/0093_tagged_item_indexes.py
Normal file
17
netbox/extras/migrations/0093_tagged_item_indexes.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 4.2.2 on 2023-06-14 23:26
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('extras', '0093_configrevision_ordering'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameIndex(
|
||||
model_name='taggeditem',
|
||||
new_name='extras_tagg_content_717743_idx',
|
||||
old_fields=('content_type', 'object_id'),
|
||||
),
|
||||
]
|
@@ -61,6 +61,4 @@ class TaggedItem(GenericTaggedItemBase):
|
||||
)
|
||||
|
||||
class Meta:
|
||||
index_together = (
|
||||
("content_type", "object_id")
|
||||
)
|
||||
indexes = [models.Index(fields=["content_type", "object_id"])]
|
||||
|
Reference in New Issue
Block a user