Coverage for django_napse/core/models/bots/managers/architecture.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.4.3, created at 2024-03-12 13:49 +0000

1from typing import Optional 

2 

3from django.db import models 

4 

5 

6class ArchitectureManager(models.Manager): 

7 def create(self, constants: Optional[dict] = None, variables: Optional[dict] = None) -> models.Model: 

8 constants = constants or {} 

9 variables = variables or {} 

10 architecture = self.model(**constants, **{f"variable_{key}": value for key, value in variables.items()}) 

11 architecture.save() 

12 return architecture