Ejemplo n.º 1
0
    def exitRolefragment(self, ctx):
        role = Role()
        role.source = self.context[-1]
        role.description = self.stack.pop()
        role.contact = self.stack.pop()
        status = self.stack.pop()
        if status == 'active':
            role.status = Role.ACTIVE
        elif status == 'disabled':
            role.status = Role.DISABLED
        else:
            role.status = Role.WORKING
        role.save()

        # Now that the role exists, we can create the other rows
        # which have FK constraints
        for row in self.rows:
            row.save()

        self.rows = []
Ejemplo n.º 2
0
    def exitRolefragment(self, ctx):
        role = Role()
        role.source = self.context[-1]
        role.description = self.stack.pop()
        role.contact = self.stack.pop()
        status = self.stack.pop()
        if status == 'active' :
            role.status = Role.ACTIVE
        elif status == 'disabled' :
            role.status = Role.DISABLED
        else :
            role.status = Role.WORKING
        role.save() 

        # Now that the role exists, we can create the other rows
        # which have FK constraints 
        for row in self.rows :
            row.save()

        self.rows = []