visibility-usage-opt

This commit is contained in:
tonyrewin 2022-11-13 07:07:52 +03:00
parent 25dd0ba553
commit a4841339ef
3 changed files with 12 additions and 22 deletions

View File

@ -347,7 +347,7 @@ def prepare_html_body(entry):
def extract_html(entry): def extract_html(entry):
body_orig = (entry.get("body") or "").replace('\(', '(').replace('/)', ')') body_orig = (entry.get("body") or "").replace('\(', '(').replace('\)', ')')
media = entry.get("media", []) media = entry.get("media", [])
kind = entry.get("type") or "" kind = entry.get("type") or ""
print("[extract] kind: " + kind) print("[extract] kind: " + kind)

View File

@ -39,14 +39,6 @@ class ShoutAuthor(Base):
caption = Column(String, nullable=True, default="") caption = Column(String, nullable=True, default="")
class ShoutAllowed(Base):
__tablename__ = "shout_allowed"
id = None # type: ignore
shout = Column(ForeignKey("shout.slug"), primary_key=True)
user = Column(ForeignKey("user.id"), primary_key=True)
class Shout(Base): class Shout(Base):
__tablename__ = "shout" __tablename__ = "shout"
@ -62,14 +54,13 @@ class Shout(Base):
authors = relationship(lambda: User, secondary=ShoutAuthor.__tablename__) authors = relationship(lambda: User, secondary=ShoutAuthor.__tablename__)
topics = relationship(lambda: Topic, secondary=ShoutTopic.__tablename__) topics = relationship(lambda: Topic, secondary=ShoutTopic.__tablename__)
reactions = relationship(lambda: Reaction) reactions = relationship(lambda: Reaction)
visibleFor = relationship(lambda: User, secondary=ShoutAllowed.__tablename__) visibility = Column(String, nullable=True) # owner authors community public
versionOf = Column(ForeignKey("shout.slug"), nullable=True)
lang = Column(String, default='ru')
oid = Column(String, nullable=True)
createdAt = Column(DateTime, nullable=False, default=datetime.now, comment="Created at") createdAt = Column(DateTime, nullable=False, default=datetime.now, comment="Created at")
updatedAt = Column(DateTime, nullable=True, comment="Updated at") updatedAt = Column(DateTime, nullable=True, comment="Updated at")
publishedAt = Column(DateTime, nullable=True) publishedAt = Column(DateTime, nullable=True)
deletedAt = Column(DateTime, nullable=True) deletedAt = Column(DateTime, nullable=True)
versionOf = Column(ForeignKey("shout.slug"), nullable=True)
draft = Column(Boolean, default=False)
lang = Column(String, default='ru')
oid = Column(String, nullable=True)

View File

@ -419,18 +419,17 @@ type Shout {
slug: String! slug: String!
body: String! body: String!
createdAt: DateTime! createdAt: DateTime!
authors: [Author]
lang: String
community: String
cover: String
layout: String
draft: Boolean
versionOf: Shout # translations and adaptations
visibleFor: [User]
topics: [Topic] topics: [Topic]
mainTopic: String mainTopic: String
title: String title: String
subtitle: String subtitle: String
authors: [Author]
lang: String
community: String
cover: String
layout: String # audio video literature image
versionOf: String # for translations and re-telling the same story
visibility: String # owner authors community public
updatedAt: DateTime updatedAt: DateTime
updatedBy: User updatedBy: User
deletedAt: DateTime deletedAt: DateTime