You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defto_datafile(self, update_from_store=True, allow_no_location=False):
...
ifupdate_from_store:
df=Datafile(path)
else:
df=Datafile(
path,
id=str(self.id), # <-- set the id; idk if this has implications in use cases other than on instance creationignore_stored_metadata=False,
tags=self.get_tags_from_instance(),
labels=self.get_labels_from_instance(),
)
Or maybe add a create_new_instance=False kwarg and create datafile with this.id as the id when called from AbstractSynchronisedDatastore.save method.
The text was updated successfully, but these errors were encountered:
Bug report
What is the current behavior?
If the current behavior is a bug, please provide any stack traces the steps reproduce and, if possible, a minimal demo of the problem.
Django model inheriting from
AbstractSynchronisedDatastore
throws aConsistencyError
while adding a new file (instance creation).What is the expected behavior?
Adding a new file using the modal doesn't raise exception.
Other information
Explicitly passing the id to Datafile when
update_from_store
isFalse
InAbstractSynchronisedDatastore
seems to solve this for me.django-twined/django_twined/models/datastores.py
Lines 107 to 112 in 016a28c
Or maybe add a
create_new_instance=False
kwarg and create datafile withthis.id
as the id when called fromAbstractSynchronisedDatastore.save
method.The text was updated successfully, but these errors were encountered: