@ -6,4 +6,13 @@ class Union(Document):
logo = ImageField(thumbnail_size=(120,120))
description = StringField()
legal_registration_number = StringField()
headquarter = StringField()
def save(self,*args, **kwargs):
super(Union, self).save(*args, **kwargs)
from .Group import Group
group = Group()
group.union = self
group.name = 'Root'
group.rights = ["*::*::{}}/*".format(self.id)]
group.save()