You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Adunatio/models/Union.py

19 lines
508 B

4 years ago
from mongoengine import *
class Union(Document):
name = StringField()
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()