Commit 6d1c82f4 authored by Lukas Burgey's avatar Lukas Burgey

Add GroupDescription

parent 25265cc6
......@@ -29,6 +29,8 @@ admin.site.register(broker_models.RabbitMQInstance)
admin.site.register(models.User, ClientAdmin)
admin.site.unregister(Group)
admin.site.register(Group)
admin.site.register(models.GroupDescription)
admin.site.register(models.Site)
admin.site.register(models.Service)
admin.site.register(models.SSHPublicKey)
......
# Generated by Django 2.1 on 2018-08-21 09:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
('backend', '0006_auto_20180813_1417'),
]
operations = [
migrations.CreateModel(
name='GroupDescription',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('description', models.TextField(max_length=1000)),
('Group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='description', to='auth.Group')),
],
),
]
# Generated by Django 2.1 on 2018-08-21 09:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backend', '0007_groupdescription'),
]
operations = [
migrations.RenameField(
model_name='groupdescription',
old_name='Group',
new_name='group',
),
]
......@@ -8,6 +8,7 @@ from django_mysql.models import JSONField
from .brokers import RabbitMQInstance
from .users import User, SSHPublicKey
from .groups import GroupDescription
LOGGER = getLogger(__name__)
......
from django.contrib.auth.models import Group
from django.db import models
class GroupDescription(models.Model):
group = models.ForeignKey(
Group,
related_name='description',
on_delete=models.CASCADE,
)
description = models.TextField(
max_length=1000,
blank=False,
)
def __str__(self):
return self.group.name + '-description'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment