Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/send message #185

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Feature/send message #185

wants to merge 3 commits into from

Conversation

Kate1109
Copy link
Collaborator

Реализована функция отправки сообщений пользователям с привязкой к БД и связкой с html формой.

Copy link
Member

@KonstantinRaikhert KonstantinRaikhert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возможно я упустил какие-то договоренности. И это драфтовый ПР?

@@ -139,3 +139,9 @@ dmypy.json

# vscode
.vscode

# .gitignore
src/bot/static/css/bootstrap.rtl.min.css.map
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не совсем понятно, почему в игноре именно эти 4 файла?
Смотрю добавлено много css. Точно ли необходимо нам это всё?
Через CDN не предлагаю, но есть такое подозрение, что далеко не вся эта статика нам необходима)

from pydantic import BaseSettings

load_dotenv()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А разве нам нужно тут загружать переменные окружения? Если мы вызываем уже там где к ним обращаемся

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

с app.py не понял. У нас точка входа же в другом файле. А тут мы заново пишем и иницируем

# Ожидание 1/30 секунды перед отправкой


async def send_messages(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По хорошему все функции отправки сообщения тогда уже убрать в другое место. Даже создать в структуре отдельную папку, будет удобнее для масштабирования

)
static_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static')
app.mount('/static', StaticFiles(directory=static_dir), name='static')
message_queue = asyncio.Queue()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется, что можно использовать jobqueue, которая есть во фреймворке

@@ -17,7 +17,7 @@ line-ending = "lf"
quote-style = "single"

[lint]
ignore=["E265", "F811", "D100", "D105", "D104", "D203", "D211", "D213", "N818", "W505", "ANN401"]
ignore=["E265", "F811", "D100", "D105", "D104", "D203", "D211", "D213", "N818", "W505", "ANN401", "COM812"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот файл правим по согласованию со мной или Константином.

@@ -1,2 +1,2 @@
from app.core.db import Base # noqa
from app.models import Group, Message, Photo, UserTG, UserGroupAssociation # noqa
from src.app.core.db import Base # noqa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src не нужно.

from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.future import select

from app.crud.base import CRUDBase
from app.models.models import UserTG
from src.app.crud.base import CRUDBase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src не нужно

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем на здесь весь bootstrap?
Достаточно bootstrap.css и bootstarp.bundle.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants