Closes #8454: Set DEFAULT_AUTO_FIELD to BigAutoField

This commit is contained in:
jeremystretch
2022-01-25 17:37:06 -05:00
parent 28de9b8913
commit e4abbfb2c6
22 changed files with 665 additions and 184 deletions
@@ -0,0 +1,26 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_squashed_0011'),
]
operations = [
migrations.AlterField(
model_name='objectpermission',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='token',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='userconfig',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False),
),
]
+2 -3
View File
@@ -11,7 +11,6 @@ from django.dispatch import receiver
from django.utils import timezone
from netbox.config import get_config
from netbox.models import BigIDModel
from utilities.querysets import RestrictedQuerySet
from utilities.utils import flatten_dict
from .constants import *
@@ -187,7 +186,7 @@ def create_userconfig(instance, created, **kwargs):
# REST API
#
class Token(BigIDModel):
class Token(models.Model):
"""
An API token used for user authentication. This extends the stock model to allow each user to have multiple tokens.
It also supports setting an expiration time and toggling write ability.
@@ -246,7 +245,7 @@ class Token(BigIDModel):
# Permissions
#
class ObjectPermission(BigIDModel):
class ObjectPermission(models.Model):
"""
A mapping of view, add, change, and/or delete permission for users and/or groups to an arbitrary set of objects
identified by ORM query parameters.