Closed JarriqTheTechie closed 7 months ago
Retrieves record by primary key. If no record exists matching the given criteria, a user-defined callback function will be executed.
eg.
id: int = 1024 callback: Callable = lambda a, b : a * b arguments: tuple = (5, 6)
User.find_or(id, callback, arguments)
The callback will run only if user with id 1024 is not found. Arguments to the callback are passed in as tuples.
@josephmancuso please review.
Test has now been added. @josephmancuso please review.
Retrieves record by primary key. If no record exists matching the given criteria, a user-defined callback function will be executed.
eg.
id: int = 1024 callback: Callable = lambda a, b : a * b arguments: tuple = (5, 6)
User.find_or(id, callback, arguments)
The callback will run only if user with id 1024 is not found. Arguments to the callback are passed in as tuples.