2021-11-24 18:53:01 +03:00
|
|
|
from orm.rbac import Operation, Resource, Permission, Role, RoleStorage
|
2022-06-12 10:51:22 +03:00
|
|
|
from orm.community import Community, CommunitySubscription
|
2021-11-24 15:56:09 +03:00
|
|
|
from orm.user import User, UserRating, UserRole, UserStorage
|
2021-12-12 16:00:38 +03:00
|
|
|
from orm.topic import Topic, TopicSubscription, TopicStorage
|
2021-08-20 11:08:32 +03:00
|
|
|
from orm.notification import Notification
|
2021-09-24 17:39:37 +03:00
|
|
|
from orm.shout import Shout, ShoutAuthor, ShoutTopic, ShoutRating, ShoutViewByDay,\
|
2022-06-21 15:21:02 +03:00
|
|
|
ShoutRatingStorage, ShoutViewStorage, ShoutCommentsSubscription
|
2021-09-24 17:39:37 +03:00
|
|
|
from orm.base import Base, engine, local_session
|
2022-06-19 20:54:39 +03:00
|
|
|
from orm.comment import Comment, CommentRating #, CommentRatingStorage
|
|
|
|
from orm.proposal import Proposal, ProposalRating #, ProposalRatingStorage
|
2021-07-13 10:14:48 +00:00
|
|
|
|
2022-06-19 20:54:39 +03:00
|
|
|
__all__ = ["User", "Role", "Community", "Operation", \
|
|
|
|
"Permission", "Shout", "Topic", "TopicSubscription", \
|
|
|
|
"Notification", "ShoutRating", "Comment", "CommentRating", \
|
|
|
|
"UserRating", "Proposal", "ProposalRating"]
|
2021-07-13 10:14:48 +00:00
|
|
|
|
|
|
|
Base.metadata.create_all(engine)
|
2021-08-17 12:14:26 +03:00
|
|
|
Operation.init_table()
|
|
|
|
Resource.init_table()
|
2021-12-10 16:52:55 +03:00
|
|
|
User.init_table()
|
2021-12-08 15:51:30 +03:00
|
|
|
Community.init_table()
|
|
|
|
Role.init_table()
|
2021-09-24 17:39:37 +03:00
|
|
|
|
|
|
|
with local_session() as session:
|
2021-09-29 16:37:08 +03:00
|
|
|
ShoutRatingStorage.init(session)
|
2022-06-19 20:54:39 +03:00
|
|
|
# CommentRatingStorage.init(session)
|
|
|
|
# ProposalRatingStorage.init(session)
|
2021-09-29 15:59:48 +03:00
|
|
|
ShoutViewStorage.init(session)
|
2021-11-24 18:53:01 +03:00
|
|
|
RoleStorage.init(session)
|
2021-11-24 15:56:09 +03:00
|
|
|
UserStorage.init(session)
|
2021-12-12 16:00:38 +03:00
|
|
|
TopicStorage.init(session)
|