union initial group save

master
Mustafa Yontar 4 years ago
parent db5233cf9d
commit 58c5d37a21
  1. 11
      models/Union.py

@ -6,4 +6,13 @@ class Union(Document):
logo = ImageField(thumbnail_size=(120,120))
description = StringField()
legal_registration_number = StringField()
headquarter = 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()

Loading…
Cancel
Save