This commit is contained in:
@@ -1,40 +1,32 @@
|
||||
from resolvers.editor import create_shout, delete_shout, update_shout
|
||||
|
||||
from resolvers.author import (
|
||||
get_author,
|
||||
get_author_followed,
|
||||
get_author_followers,
|
||||
get_author_id,
|
||||
load_authors_all,
|
||||
get_author_followers,
|
||||
get_author_followed,
|
||||
load_authors_by,
|
||||
update_profile,
|
||||
rate_author,
|
||||
update_profile,
|
||||
)
|
||||
|
||||
from resolvers.community import get_communities_all, get_community
|
||||
from resolvers.editor import create_shout, delete_shout, update_shout
|
||||
from resolvers.follower import follow, get_my_followed, unfollow
|
||||
from resolvers.reaction import (
|
||||
create_reaction,
|
||||
update_reaction,
|
||||
delete_reaction,
|
||||
load_reactions_by,
|
||||
load_shouts_followed,
|
||||
update_reaction,
|
||||
)
|
||||
from resolvers.topic import (
|
||||
get_topics_by_author,
|
||||
get_topics_by_community,
|
||||
get_topics_all,
|
||||
get_topic,
|
||||
)
|
||||
|
||||
from resolvers.follower import follow, unfollow, get_my_followed
|
||||
from resolvers.reader import (
|
||||
get_shout,
|
||||
load_shouts_by,
|
||||
load_shouts_feed,
|
||||
load_shouts_random_top,
|
||||
load_shouts_search,
|
||||
load_shouts_unrated,
|
||||
load_shouts_random_top,
|
||||
)
|
||||
from resolvers.community import get_community, get_communities_all
|
||||
from resolvers.topic import get_topic, get_topics_all, get_topics_by_author, get_topics_by_community
|
||||
|
||||
__all__ = [
|
||||
# author
|
||||
|
@@ -1,20 +1,21 @@
|
||||
import time
|
||||
from typing import List
|
||||
from sqlalchemy import and_, func, distinct, select, literal, case
|
||||
|
||||
from sqlalchemy import and_, case, distinct, func, literal, select
|
||||
from sqlalchemy.orm import aliased
|
||||
|
||||
from orm.reaction import Reaction, ReactionKind
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.unread import get_total_unread_counter
|
||||
from services.schema import mutation, query
|
||||
from orm.author import Author, AuthorFollower, AuthorRating
|
||||
from orm.community import Community
|
||||
from orm.reaction import Reaction, ReactionKind
|
||||
from orm.shout import ShoutAuthor, ShoutTopic
|
||||
from orm.topic import Topic
|
||||
from orm.author import AuthorFollower, Author, AuthorRating
|
||||
from resolvers.community import followed_communities
|
||||
from resolvers.topic import followed_topics
|
||||
from resolvers.reaction import reacted_shouts_updates as followed_reactions
|
||||
from resolvers.topic import followed_topics
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.schema import mutation, query
|
||||
from services.unread import get_total_unread_counter
|
||||
|
||||
|
||||
def add_author_stat_columns(q):
|
||||
|
@@ -1,9 +1,9 @@
|
||||
from orm.author import Author
|
||||
from orm.invite import Invite, InviteStatus
|
||||
from orm.shout import Shout
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.schema import mutation
|
||||
from orm.invite import Invite, InviteStatus
|
||||
from orm.author import Author
|
||||
from orm.shout import Shout
|
||||
|
||||
|
||||
@mutation.field("accept_invite")
|
||||
|
@@ -1,10 +1,11 @@
|
||||
from services.db import local_session
|
||||
from services.schema import query
|
||||
from sqlalchemy import and_, distinct, func, literal, select
|
||||
from sqlalchemy.orm import aliased
|
||||
|
||||
from orm.author import Author
|
||||
from orm.community import Community, CommunityAuthor
|
||||
from orm.shout import ShoutCommunity
|
||||
from sqlalchemy import select, distinct, func, literal, and_
|
||||
from sqlalchemy.orm import aliased
|
||||
from services.db import local_session
|
||||
from services.schema import query
|
||||
|
||||
|
||||
def add_community_stat_columns(q):
|
||||
|
@@ -1,15 +1,16 @@
|
||||
import time # For Unix timestamps
|
||||
|
||||
from sqlalchemy import and_, select
|
||||
from sqlalchemy.orm import joinedload
|
||||
|
||||
from orm.author import Author
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.schema import mutation, query
|
||||
from orm.shout import Shout, ShoutAuthor, ShoutTopic, ShoutVisibility
|
||||
from orm.topic import Topic
|
||||
from resolvers.reaction import reactions_follow, reactions_unfollow
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.notify import notify_shout
|
||||
from services.schema import mutation, query
|
||||
|
||||
|
||||
@query.field("get_shouts_drafts")
|
||||
|
@@ -2,18 +2,18 @@ from typing import List
|
||||
|
||||
from sqlalchemy import select
|
||||
|
||||
from orm.community import Community, CommunityAuthor
|
||||
from orm.author import Author, AuthorFollower
|
||||
from orm.community import Community
|
||||
from orm.reaction import Reaction
|
||||
from orm.shout import Shout
|
||||
from orm.topic import Topic, TopicFollower
|
||||
from services.auth import login_required
|
||||
from resolvers.author import author_follow, author_unfollow
|
||||
from resolvers.community import community_follow, community_unfollow
|
||||
from resolvers.reaction import reactions_follow, reactions_unfollow
|
||||
from resolvers.topic import topic_follow, topic_unfollow
|
||||
from resolvers.community import community_follow, community_unfollow
|
||||
from services.following import FollowingManager, FollowingResult
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from orm.author import Author, AuthorFollower
|
||||
from services.following import FollowingManager, FollowingResult
|
||||
from services.notify import notify_follower
|
||||
from services.schema import mutation, query
|
||||
|
||||
|
@@ -1,15 +1,16 @@
|
||||
import time
|
||||
from typing import List
|
||||
|
||||
from sqlalchemy import and_, asc, desc, select, text, func, case
|
||||
from sqlalchemy import and_, asc, case, desc, func, select, text
|
||||
from sqlalchemy.orm import aliased, joinedload
|
||||
from services.notify import notify_reaction
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.schema import mutation, query
|
||||
|
||||
from orm.author import Author
|
||||
from orm.reaction import Reaction, ReactionKind
|
||||
from orm.shout import Shout, ShoutReactionsFollower
|
||||
from orm.author import Author
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.notify import notify_reaction
|
||||
from services.schema import mutation, query
|
||||
|
||||
|
||||
def add_reaction_stat_columns(q):
|
||||
|
@@ -1,15 +1,15 @@
|
||||
from sqlalchemy import distinct, bindparam, or_
|
||||
from sqlalchemy import bindparam, distinct, or_
|
||||
from sqlalchemy.orm import aliased, joinedload
|
||||
from sqlalchemy.sql.expression import and_, asc, case, desc, func, nulls_last, select
|
||||
from starlette.exceptions import HTTPException
|
||||
|
||||
from orm.author import Author, AuthorFollower
|
||||
from orm.reaction import Reaction, ReactionKind
|
||||
from orm.shout import Shout, ShoutAuthor, ShoutTopic, ShoutVisibility
|
||||
from orm.topic import Topic, TopicFollower
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.schema import query
|
||||
from orm.topic import TopicFollower, Topic
|
||||
from orm.reaction import Reaction, ReactionKind
|
||||
from orm.shout import Shout, ShoutAuthor, ShoutTopic, ShoutVisibility
|
||||
from orm.author import AuthorFollower, Author
|
||||
from services.search import SearchService
|
||||
from services.viewed import ViewedStorage
|
||||
|
||||
@@ -161,7 +161,9 @@ async def load_shouts_by(_, _info, options):
|
||||
session.query(Topic.slug)
|
||||
.join(
|
||||
ShoutTopic,
|
||||
and_(ShoutTopic.topic == Topic.id, ShoutTopic.shout == shout.id, ShoutTopic.main == True),
|
||||
and_(
|
||||
ShoutTopic.topic == Topic.id, ShoutTopic.shout == shout.id, ShoutTopic.main == True
|
||||
), # noqa: E712
|
||||
)
|
||||
.first()
|
||||
)
|
||||
|
@@ -1,12 +1,12 @@
|
||||
from sqlalchemy import and_, select, distinct, func
|
||||
from sqlalchemy import and_, distinct, func, select
|
||||
from sqlalchemy.orm import aliased
|
||||
|
||||
from orm.author import Author
|
||||
from orm.shout import ShoutAuthor, ShoutTopic
|
||||
from orm.topic import Topic, TopicFollower
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.schema import mutation, query
|
||||
from orm.shout import ShoutTopic, ShoutAuthor
|
||||
from orm.topic import Topic, TopicFollower
|
||||
from orm.author import Author
|
||||
|
||||
|
||||
async def followed_topics(follower_id):
|
||||
|
Reference in New Issue
Block a user