This commit is contained in:
@@ -1,54 +1,24 @@
|
||||
from resolvers.author import (
|
||||
get_author,
|
||||
get_author_follows,
|
||||
get_author_follows_topics,
|
||||
get_author_follows_authors,
|
||||
get_author_followers,
|
||||
get_author_id,
|
||||
get_authors_all,
|
||||
load_authors_by,
|
||||
update_author,
|
||||
search_authors,
|
||||
)
|
||||
from resolvers.rating import rate_author
|
||||
from resolvers.author import (get_author, get_author_followers,
|
||||
get_author_follows, get_author_follows_authors,
|
||||
get_author_follows_topics, get_author_id,
|
||||
get_authors_all, load_authors_by, search_authors,
|
||||
update_author)
|
||||
from resolvers.community import get_communities_all, get_community
|
||||
from resolvers.editor import create_shout, delete_shout, update_shout
|
||||
from resolvers.follower import (
|
||||
follow,
|
||||
unfollow,
|
||||
get_topic_followers,
|
||||
get_shout_followers,
|
||||
)
|
||||
from resolvers.reaction import (
|
||||
create_reaction,
|
||||
delete_reaction,
|
||||
load_reactions_by,
|
||||
load_shouts_followed,
|
||||
update_reaction,
|
||||
)
|
||||
from resolvers.reader import (
|
||||
get_shout,
|
||||
load_shouts_by,
|
||||
load_shouts_feed,
|
||||
load_shouts_random_top,
|
||||
load_shouts_random_topic,
|
||||
load_shouts_search,
|
||||
load_shouts_unrated,
|
||||
)
|
||||
from resolvers.topic import (
|
||||
get_topic,
|
||||
get_topics_all,
|
||||
get_topics_by_author,
|
||||
get_topics_by_community,
|
||||
)
|
||||
|
||||
from resolvers.notifier import (
|
||||
load_notifications,
|
||||
notification_mark_seen,
|
||||
notifications_seen_after,
|
||||
notifications_seen_thread,
|
||||
)
|
||||
|
||||
from resolvers.follower import (follow, get_shout_followers,
|
||||
get_topic_followers, unfollow)
|
||||
from resolvers.notifier import (load_notifications, notification_mark_seen,
|
||||
notifications_seen_after,
|
||||
notifications_seen_thread)
|
||||
from resolvers.rating import rate_author
|
||||
from resolvers.reaction import (create_reaction, delete_reaction,
|
||||
load_reactions_by, load_shouts_followed,
|
||||
update_reaction)
|
||||
from resolvers.reader import (get_shout, load_shouts_by, load_shouts_feed,
|
||||
load_shouts_random_top, load_shouts_random_topic,
|
||||
load_shouts_search, load_shouts_unrated)
|
||||
from resolvers.topic import (get_topic, get_topics_all, get_topics_by_author,
|
||||
get_topics_by_community)
|
||||
from services.cache import events_register
|
||||
|
||||
events_register()
|
||||
|
@@ -2,27 +2,23 @@ import asyncio
|
||||
import json
|
||||
import time
|
||||
|
||||
from sqlalchemy import select, or_, and_, text, desc
|
||||
from sqlalchemy import and_, desc, or_, select, text
|
||||
from sqlalchemy.orm import aliased
|
||||
from sqlalchemy_searchable import search
|
||||
|
||||
from orm.author import Author, AuthorFollower
|
||||
from orm.shout import ShoutAuthor, ShoutTopic
|
||||
from orm.topic import Topic
|
||||
from resolvers.stat import (
|
||||
get_authors_with_stat_cached,
|
||||
author_follows_authors,
|
||||
author_follows_topics,
|
||||
get_with_stat,
|
||||
)
|
||||
from services.cache import set_author_cache, update_author_followers_cache
|
||||
from resolvers.stat import (author_follows_authors, author_follows_topics,
|
||||
get_authors_with_stat_cached, get_with_stat)
|
||||
from services.auth import login_required
|
||||
from services.cache import set_author_cache, update_author_followers_cache
|
||||
from services.db import local_session
|
||||
from services.encoders import CustomJSONEncoder
|
||||
from services.logger import root_logger as logger
|
||||
from services.memorycache import cache_region
|
||||
from services.rediscache import redis
|
||||
from services.schema import mutation, query
|
||||
from services.logger import root_logger as logger
|
||||
|
||||
|
||||
@mutation.field('update_author')
|
||||
|
@@ -5,8 +5,8 @@ from orm.author import Author
|
||||
from orm.community import Community, CommunityAuthor
|
||||
from orm.shout import ShoutCommunity
|
||||
from services.db import local_session
|
||||
from services.schema import query
|
||||
from services.logger import root_logger as logger
|
||||
from services.schema import query
|
||||
|
||||
|
||||
def add_community_stat_columns(q):
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import time
|
||||
|
||||
from sqlalchemy import and_, select, desc
|
||||
from sqlalchemy import and_, desc, select
|
||||
from sqlalchemy.orm import joinedload
|
||||
from sqlalchemy.sql.functions import coalesce
|
||||
|
||||
@@ -13,10 +13,10 @@ from resolvers.follower import reactions_follow, reactions_unfollow
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.diff import apply_diff, get_diff
|
||||
from services.logger import root_logger as logger
|
||||
from services.notify import notify_shout
|
||||
from services.schema import mutation, query
|
||||
from services.search import search_service
|
||||
from services.logger import root_logger as logger
|
||||
|
||||
|
||||
@query.field('get_my_shout')
|
||||
|
@@ -3,33 +3,26 @@ import time
|
||||
from typing import List
|
||||
|
||||
from psycopg2.errors import UniqueViolation
|
||||
from sqlalchemy import select, or_
|
||||
from sqlalchemy import or_, select
|
||||
from sqlalchemy.sql import and_
|
||||
|
||||
from orm.author import Author, AuthorFollower
|
||||
from orm.community import Community
|
||||
|
||||
# from orm.community import Community
|
||||
from orm.reaction import Reaction
|
||||
from orm.shout import Shout, ShoutReactionsFollower
|
||||
from orm.topic import Topic, TopicFollower
|
||||
from resolvers.stat import (
|
||||
get_authors_with_stat_cached,
|
||||
author_follows_topics,
|
||||
author_follows_authors,
|
||||
get_topics_with_stat_cached,
|
||||
)
|
||||
from resolvers.stat import (author_follows_authors, author_follows_topics,
|
||||
get_authors_with_stat_cached,
|
||||
get_topics_with_stat_cached)
|
||||
from services.auth import login_required
|
||||
from services.cache import (DEFAULT_FOLLOWS, update_followers_for_author,
|
||||
update_follows_for_author)
|
||||
from services.db import local_session
|
||||
from services.cache import (
|
||||
DEFAULT_FOLLOWS,
|
||||
update_follows_for_author,
|
||||
update_followers_for_author,
|
||||
)
|
||||
from services.notify import notify_follower
|
||||
from services.schema import mutation, query
|
||||
from services.logger import root_logger as logger
|
||||
from services.notify import notify_follower
|
||||
from services.rediscache import redis
|
||||
from services.schema import mutation, query
|
||||
|
||||
|
||||
@mutation.field('follow')
|
||||
|
@@ -2,24 +2,19 @@ import json
|
||||
import time
|
||||
from typing import List, Tuple
|
||||
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from orm.author import Author
|
||||
from orm.shout import Shout
|
||||
from services.auth import login_required
|
||||
from services.schema import mutation, query
|
||||
from sqlalchemy import and_, select
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
from sqlalchemy.orm import aliased
|
||||
from sqlalchemy.sql import not_
|
||||
|
||||
from orm.notification import (
|
||||
Notification,
|
||||
NotificationAction,
|
||||
NotificationEntity,
|
||||
NotificationSeen,
|
||||
)
|
||||
from orm.author import Author
|
||||
from orm.notification import (Notification, NotificationAction,
|
||||
NotificationEntity, NotificationSeen)
|
||||
from orm.shout import Shout
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.logger import root_logger as logger
|
||||
from services.schema import mutation, query
|
||||
|
||||
|
||||
def query_notifications(
|
||||
|
@@ -1,7 +1,7 @@
|
||||
from sqlalchemy import and_, func, case, true, select
|
||||
from sqlalchemy import and_, case, func, select, true
|
||||
from sqlalchemy.orm import aliased
|
||||
|
||||
from orm.author import AuthorRating, Author
|
||||
from orm.author import Author, AuthorRating
|
||||
from orm.reaction import Reaction, ReactionKind
|
||||
from orm.shout import Shout
|
||||
from services.auth import login_required
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import time
|
||||
from typing import List
|
||||
|
||||
from sqlalchemy import and_, case, desc, func, select, text, asc
|
||||
from sqlalchemy import and_, asc, case, desc, func, select, text
|
||||
from sqlalchemy.orm import aliased, joinedload
|
||||
from sqlalchemy.sql import union
|
||||
|
||||
@@ -13,10 +13,10 @@ from resolvers.editor import handle_proposing
|
||||
from resolvers.follower import reactions_follow
|
||||
from services.auth import add_user_role, login_required
|
||||
from services.db import local_session
|
||||
from services.logger import root_logger as logger
|
||||
from services.notify import notify_reaction
|
||||
from services.schema import mutation, query
|
||||
from services.viewed import ViewedStorage
|
||||
from services.logger import root_logger as logger
|
||||
|
||||
|
||||
def add_reaction_stat_columns(q, aliased_reaction):
|
||||
|
@@ -1,6 +1,7 @@
|
||||
from sqlalchemy import bindparam, distinct, or_, text
|
||||
from sqlalchemy.orm import aliased, joinedload
|
||||
from sqlalchemy.sql.expression import and_, asc, case, desc, func, nulls_last, select
|
||||
from sqlalchemy.sql.expression import (and_, asc, case, desc, func, nulls_last,
|
||||
select)
|
||||
|
||||
from orm.author import Author, AuthorFollower
|
||||
from orm.reaction import Reaction, ReactionKind
|
||||
@@ -10,10 +11,10 @@ from resolvers.reaction import add_reaction_stat_columns
|
||||
from resolvers.topic import get_topics_random
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.logger import root_logger as logger
|
||||
from services.schema import query
|
||||
from services.search import search_text
|
||||
from services.viewed import ViewedStorage
|
||||
from services.logger import root_logger as logger
|
||||
|
||||
|
||||
def query_shouts():
|
||||
|
@@ -1,14 +1,14 @@
|
||||
import json
|
||||
|
||||
from sqlalchemy import func, distinct, select, join, and_
|
||||
from sqlalchemy import and_, distinct, func, join, select
|
||||
from sqlalchemy.orm import aliased
|
||||
|
||||
from orm.author import Author, AuthorFollower
|
||||
from orm.reaction import Reaction, ReactionKind
|
||||
from orm.shout import Shout, ShoutAuthor, ShoutTopic
|
||||
from orm.topic import Topic, TopicFollower
|
||||
from resolvers.rating import add_author_rating_columns
|
||||
from orm.topic import TopicFollower, Topic
|
||||
from services.db import local_session
|
||||
from orm.author import AuthorFollower, Author
|
||||
from orm.shout import ShoutTopic, ShoutAuthor, Shout
|
||||
from services.logger import root_logger as logger
|
||||
from services.rediscache import redis
|
||||
|
||||
|
@@ -6,8 +6,8 @@ from orm.topic import Topic
|
||||
from resolvers.stat import get_topics_with_stat_cached, get_with_stat
|
||||
from services.auth import login_required
|
||||
from services.db import local_session
|
||||
from services.schema import mutation, query
|
||||
from services.memorycache import cache_region
|
||||
from services.schema import mutation, query
|
||||
|
||||
|
||||
@query.field('get_topics_all')
|
||||
|
Reference in New Issue
Block a user