Ryan Barrett 2023-02-24 21:59:12 -06:00
rodzic 42c648284d
commit aa483ded0b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -301,10 +301,12 @@ class Object(StringIdModel):
@ndb.ComputedProperty
def type(self): # AS1 objectType, or verb if it's an activity
return as1.object_type(self.as1)
if self.as1:
return as1.object_type(self.as1)
def _object_ids(self): # id(s) of inner objects
return as1.get_ids(self.as1, 'object')
if self.as1:
return as1.get_ids(self.as1, 'object')
object_ids = ndb.ComputedProperty(_object_ids, repeated=True)
deleted = ndb.BooleanProperty()

Wyświetl plik

@ -294,6 +294,9 @@ class ObjectTest(testutil.TestCase):
self.assertNotIn(common.get_object.cache_key('x#y'), common.get_object.cache)
self.assertNotIn(common.get_object.cache_key('x'), common.get_object.cache)
def test_computed_properties_without_as1(self):
Object(id='a').put()
class FollowerTest(testutil.TestCase):