archivesspace-labs / ArchivesSnake

A client library for working with the ArchivesSpace API
https://archivesspace-labs.github.io/ArchivesSnake/
Other
78 stars 13 forks source link

Basic save functionality in abstraction layer #19

Open pobocks opened 6 years ago

pobocks commented 6 years ago

It's desirable to make it convenient to alter and save JSONModelObjects up to the database. Proposed API something like:


# On JSONModelObjects
def save(self, refetch_if_stale=True): 
    pass # signature, body omitted

my_obj = aspace.repositories(2).resources(1)
my_obj.dirty # False
my_obj.title = "a title"
my_obj.dirty # True
my_obj.save() # saves to ASpace
my_obj.dirty # False
pobocks commented 5 years ago

This is gonna be waaaay more complex than I initially thought, because nested objects.