Closed fokoenecke closed 10 years ago
I did not change anything on my primary key and it is found in the object_id property, but
pk_value = getattr(self, pk[0])
fails to get a value.
Do you mean it raises AttributeError
, or returns None
?
It returns None. pk[0] is my 'user_data_id'.
It might be related to Session
’s autoflush
and autocommit
settings. How are your settings?
You were right! I am using the default on both values, so I guess autoflush
is enabled
and autocommit
is disabled
. I tried to flush manually before calling .locate()
and it works:
DBSession.flush()
thumb_location = thumb.locate()
This also explains a behaviour i didn't understand earlier. Many thanks for your help!
Hi! I am trying to generate thumbnails for my attached images (v.0.8.1). Unfortunately I am getting 'NotImplementedError: object_id property has to be implemented' when calling .locate() on them. I tried everything in the documentation and debugged through the code, but could not figure out why this happens.
My code looks like this:
I did not change anything on my primary key and it is found in the object_id property, but
fails to get a value.