Closed
Description
Environment
- DiffSync version: 1.1.0
Ability to either get or create an object like the Django ORM
Function that takes the identifiers of an object and either gets or create an object.
Current work around is wrap an object get in an exception of ObjectNotFound
.
Use Case
Currently using try
and except
to catch if an object already exists.
try:
self.add(vrf)
except ObjectAlreadyExists:
pass
Expected use
self.get_or_create(vrf)
self.update_or_create(vrf)