MCPcopy Index your code
hub / github.com/diffgram/diffgram / init_existing_instances

Method init_existing_instances

shared/annotation.py:782–806  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

780 return result
781
782 def init_existing_instances(self):
783
784 if self.is_new_file is True:
785 self.instance_list_existing = []
786 return
787
788 if self.do_init_existing_instances is False:
789 return
790 # for performance reasons, ie if updating single instance.
791
792 # For better performance, we can exclude remove
793 # But then have to figure out how to handle the undo case - otherwise all the deleted
794 # ones will get recreated. Maybe the front end should only send != soft delete ones?
795 # once it gets here, we don't know if it's a new soft delete or was an existing (without checking)
796 self.instance_list_existing = Instance.list(session = self.session,
797 file_id = self.file.id,
798 limit = None,
799 sort_by = 'created_time',
800 exclude_removed = False,
801 with_for_update = True)
802 self.instance_list_existing = self.detect_and_remove_collisions(self.instance_list_existing)
803 self.instance_list_existing = self.rehash_existing_instances(self.instance_list_existing)
804
805 for instance in self.instance_list_existing:
806 self.instance_list_existing_dict[instance.id] = instance
807
808 def get_allowed_label_file_ids(self):
809 """

Callers 1

__post_init__Method · 0.95

Calls 3

listMethod · 0.45

Tested by

no test coverage detected