# Generated by Django 4.1 on 2022-08-11 14:10

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Perm',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('generic', 'generic'), ('model', 'model'), ('object', 'object'), ('field', 'field')], default='generic', max_length=10)),
                ('codename', models.CharField(max_length=100, verbose_name='codename')),
                ('name', models.CharField(blank=True, max_length=255, null=True, verbose_name='name')),
                ('object_id', models.TextField(blank=True, null=True, verbose_name='object pk')),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype', verbose_name='content type')),
                ('users', models.ManyToManyField(blank=True, related_name='xperms', to=settings.AUTH_USER_MODEL, verbose_name='users')),
            ],
            options={
                'base_manager_name': 'related_manager',
            },
            managers=[
                ('related_manager', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codename', models.CharField(blank=True, max_length=100, null=True, unique=True, verbose_name='codename')),
                ('name', models.CharField(max_length=255, verbose_name='name')),
                ('description', models.CharField(blank=True, default='', max_length=180)),
                ('users', models.ManyToManyField(blank=True, related_name='xgroups', to=settings.AUTH_USER_MODEL, verbose_name='users')),
                ('xgroups', models.ManyToManyField(blank=True, related_name='parents', to='xperms.group', verbose_name='subgroups')),
                ('xperms', models.ManyToManyField(blank=True, related_name='xgroups', to='xperms.perm', verbose_name='permissions')),
            ],
            options={
                'verbose_name': 'permission group',
                'verbose_name_plural': 'permission groups',
                'ordering': ('codename',),
            },
        ),
    ]
