add group administration

This commit is contained in:
Jens Langhammer
2019-03-08 15:49:45 +01:00
parent ca663d16fc
commit 2d7e8f1b50
9 changed files with 195 additions and 118 deletions

View File

@ -8,7 +8,7 @@ from typing import Tuple, Union
from uuid import uuid4
from django.contrib.auth.models import AbstractUser
from django.contrib.postgres.fields import ArrayField
from django.contrib.postgres.fields import ArrayField, HStoreField
from django.db import models
from django.urls import reverse_lazy
from django.utils.timezone import now
@ -31,7 +31,7 @@ class Group(UUIDModel):
name = models.CharField(_('name'), max_length=80)
parent = models.ForeignKey('Group', blank=True, null=True,
on_delete=models.SET_NULL, related_name='children')
extra_data = models.TextField(blank=True)
tags = HStoreField(default=dict)
def __str__(self):
return "Group %s" % self.name