Skip to content

Instantly share code, notes, and snippets.

@AlanCoding
Last active June 30, 2025 17:49
Show Gist options
  • Save AlanCoding/060432d2e72e249f05d8a1d5abb7f888 to your computer and use it in GitHub Desktop.
Save AlanCoding/060432d2e72e249f05d8a1d5abb7f888 to your computer and use it in GitHub Desktop.

What I ran, and the start of the output.

$ python manage.py inspectdb dab_rbac_roledefinition dab_rbac_dabpermission dab_rbac_roleuserassignment dab_rbac_roleteamassignment dab_rbac_roleevaluation dab_rbac_roleevaluationuuid dab_rbac_objectrole
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
#   * Rearrange models' order
#   * Make sure each model has one field with primary_key=True
#   * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
#   * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from django.db import models

from django.db import models
class DabRbacRoledefinition(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.TextField(unique=True)
description = models.TextField()
managed = models.BooleanField()
content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING, blank=True, null=True)
created_by = models.ForeignKey('TestAppUser', models.DO_NOTHING, blank=True, null=True)
created = models.DateTimeField()
modified_by = models.ForeignKey('TestAppUser', models.DO_NOTHING, related_name='dabrbacroledefinition_modified_by_set', blank=True, null=True)
modified = models.DateTimeField()
class Meta:
managed = False
db_table = 'dab_rbac_roledefinition'
class DabRbacDabpermission(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=255)
codename = models.CharField(max_length=100)
content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING)
class Meta:
managed = False
db_table = 'dab_rbac_dabpermission'
unique_together = (('content_type', 'codename'),)
class DabRbacRoleuserassignment(models.Model):
id = models.BigAutoField(primary_key=True)
created = models.DateTimeField()
content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING, blank=True, null=True)
object_id = models.TextField(blank=True, null=True)
role_definition = models.ForeignKey(DabRbacRoledefinition, models.DO_NOTHING)
created_by = models.ForeignKey('TestAppUser', models.DO_NOTHING, blank=True, null=True)
user = models.ForeignKey('TestAppUser', models.DO_NOTHING, related_name='dabrbacroleuserassignment_user_set')
object_role = models.ForeignKey('DabRbacObjectrole', models.DO_NOTHING, blank=True, null=True)
class Meta:
managed = False
db_table = 'dab_rbac_roleuserassignment'
unique_together = (('user', 'object_role'),)
class DabRbacRoleteamassignment(models.Model):
id = models.BigAutoField(primary_key=True)
created = models.DateTimeField()
content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING, blank=True, null=True)
object_id = models.TextField(blank=True, null=True)
role_definition = models.ForeignKey(DabRbacRoledefinition, models.DO_NOTHING)
created_by = models.ForeignKey('TestAppUser', models.DO_NOTHING, blank=True, null=True)
team = models.ForeignKey('TestAppTeam', models.DO_NOTHING)
object_role = models.ForeignKey('DabRbacObjectrole', models.DO_NOTHING, blank=True, null=True)
class Meta:
managed = False
db_table = 'dab_rbac_roleteamassignment'
unique_together = (('team', 'object_role'),)
class DabRbacRoleevaluation(models.Model):
id = models.BigAutoField(primary_key=True)
codename = models.TextField()
content_type_id = models.IntegerField()
object_id = models.IntegerField()
role = models.ForeignKey('DabRbacObjectrole', models.DO_NOTHING)
class Meta:
managed = False
db_table = 'dab_rbac_roleevaluation'
unique_together = (('object_id', 'content_type_id', 'codename', 'role'),)
class DabRbacRoleevaluationuuid(models.Model):
id = models.BigAutoField(primary_key=True)
codename = models.TextField()
content_type_id = models.IntegerField()
object_id = models.UUIDField()
role = models.ForeignKey('DabRbacObjectrole', models.DO_NOTHING)
class Meta:
managed = False
db_table = 'dab_rbac_roleevaluationuuid'
unique_together = (('object_id', 'content_type_id', 'codename', 'role'),)
class DabRbacObjectrole(models.Model):
id = models.BigAutoField(primary_key=True)
object_id = models.TextField()
content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING)
role_definition = models.ForeignKey(DabRbacRoledefinition, models.DO_NOTHING)
class Meta:
managed = False
db_table = 'dab_rbac_objectrole'
unique_together = (('object_id', 'content_type', 'role_definition'),)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment