Cleanup, more typing for queries
This commit is contained in:
parent
d4590996e0
commit
5b9a0cb286
5 changed files with 43 additions and 28 deletions
|
@ -28,6 +28,7 @@ class MetaKey(Enum):
|
|||
GC_KEEP = "gc_keep"
|
||||
OBJECT = "object"
|
||||
OBJECT_ACTOR = "object_actor"
|
||||
PUBLIC = "public"
|
||||
|
||||
|
||||
def _meta(mk: MetaKey) -> str:
|
||||
|
@ -56,3 +57,7 @@ def not_undo() -> _SubQuery:
|
|||
|
||||
def by_actor(actor: ap.BaseActivity) -> _SubQuery:
|
||||
return {_meta(MetaKey.ACTOR_ID): actor.id}
|
||||
|
||||
|
||||
def is_public() -> _SubQuery:
|
||||
return {_meta(MetaKey.PUBLIC): True}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue