예제 #1
0
 def create_branches(self):
     """
     Cadastra os Ramos
     """
     #print("CADASTRAR RAMOS:")
     for branch in BRANCHS:
         branch_new = Branch()
         branch_new.id = branch['id']
         branch_new.name = branch['name']
         branch_new.description = branch['description']
         branch_new.active = branch['active']
         if branch.get('group'):
             branch_new.group = Group.objects.get(pk=branch['group']['id'])
         branch_new.save()