Locazia: v1 auth (not tested yet)
This commit is contained in:
1 parent
9638f5a31b
commit
e1edae9b29
15 files changed
+419
-4
No files matched your search
@@ -2,10 +2,12 @@ from sqlalchemy import Column, Integer, String, BigInteger, DateTime, JSON
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from app.core.translation import TranslationCore
|
||||
from app.core.auth_v1 import AuthenticationMixin as AuthenticationMixin_V1
|
||||
from app.core.models.user.display_mixin import DisplayMixin
|
||||
from ..base import AlchemyBase
|
||||
|
||||
|
||||
class User(AlchemyBase, TranslationCore):
|
||||
class User(AlchemyBase, DisplayMixin, TranslationCore, AuthenticationMixin_V1):
|
||||
LOCALE_DOMAIN = 'sanic_telegram_bot'
|
||||
|
||||
__tablename__ = 'users'
|
||||
@@ -22,6 +24,7 @@ class User(AlchemyBase, TranslationCore):
|
||||
balances = relationship('UserBalance', back_populates='user')
|
||||
internal_transactions = relationship('InternalTransaction', back_populates='user')
|
||||
wallet_connections = relationship('WalletConnection', back_populates='user')
|
||||
# stored_content = relationship('StoredContent', back_populates='user')
|
||||
|
||||
def __str__(self):
|
||||
return f"User, {self.id}_{self.telegram_id} | Username: {self.username} " + '\\'
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
class DisplayMixin:
|
||||
def json_format(self):
|
||||
return {
|
||||
"id": self.id,
|
||||
"telegram_id": self.telegram_id,
|
||||
"username": self.username,
|
||||
"lang_code": self.lang_code,
|
||||
"meta": self.meta,
|
||||
"last_use": self.last_use,
|
||||
"created": self.created
|
||||
}
|
||||
Reference in new issue
Block a user