Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable deep copy of nested object, allowing to change properties of instances inside classes after their instantiation #50

Merged
merged 2 commits into from
May 20, 2022

Conversation

giacomomarchioro
Copy link
Contributor

@giacomomarchioro giacomomarchioro commented May 13, 2022

The user can now change the values of the IIIF object after it has been instantiated using the reference to the original object.

from iiif_prezi3 import Canvas, Manifest

originalID = 'http://iiif.example.org/TESTORIGINAL'
amanifest = Manifest(id='http://iiif.example.org/prezi/Manifest/0', type='Manifest', label={'en': ['default label']})
acanvas = Canvas(id='http://iiif.example.org/prezi/Manifest/0/canvas/01', type='Canvas', label={'en': ['default label']})
asecondcanvas = Canvas(id=originalID, type='Canvas', label={'en': ['second label']})
changedID = 'http://iiif.example.org/TESTCHANGED'
amanifest.items = [acanvas, asecondcanvas]
# we change the id of the first canvas
acanvas.id = changedID
amanifest.items[0].id, changedID

This should fix: #35

@glenrobson glenrobson merged commit 8da9bcd into iiif-prezi:main May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connect Reference to Referenced Resource
2 participants