-
Notifications
You must be signed in to change notification settings - Fork 275
Duplicating Files
Janko Marohnić edited this page Nov 30, 2019
·
1 revision
The following example copies the attachment of one record and assigns it to another:
source_attacher = record1.file_attacher
destination_attacher = record2.file_attacher
destination_attacher.attach source_attacher.file
destination_attacher.add_derivatives source_attacher.derivatives # if using derivatives
The following example assigns the attachment of one record to another without copying it:
source_attacher = record1.file_attacher
destination_attacher = record2.file_attacher
destination_attacher.set source_attacher.file
destination_attacher.set_derivatives source_attacher.derivatives # if using derivatives