Implement the structured groups backend
This implements a structured user group model, propagating its changes to vanilla Django groups. It features cycle detection at save-time, although this cycle detection can only be seen as a fallback and forms should check the acyclicity of their changes before committing using the provided class method.
This commit is contained in:
parent
d9da1ef528
commit
d3f80f2339
9 changed files with 193 additions and 0 deletions
27
wiki_groups/migrations/0001_initial.py
Normal file
27
wiki_groups/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Generated by Django 2.2.8 on 2019-12-16 00:01
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('auth', '0011_update_proxy_permissions'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='WikiGroup',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('django_group', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='auth.Group')),
|
||||
('includes_groups', models.ManyToManyField(blank=True, related_name='included_in_groups', to='wiki_groups.WikiGroup')),
|
||||
('users', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue