2021-11-24 15:53:01 +00:00
|
|
|
from orm.rbac import Operation, Resource, Permission, Role, RoleStorage
|
2022-06-12 07:51:22 +00:00
|
|
|
from orm.community import Community, CommunitySubscription
|
2021-11-24 12:56:09 +00:00
|
|
|
from orm.user import User, UserRating, UserRole, UserStorage
|
2021-12-12 13:00:38 +00:00
|
|
|
from orm.topic import Topic, TopicSubscription, TopicStorage
|
2021-08-20 08:08:32 +00:00
|
|
|
from orm.notification import Notification
|
2021-09-24 14:39:37 +00:00
|
|
|
from orm.shout import Shout, ShoutAuthor, ShoutTopic, ShoutRating, ShoutViewByDay,\
|
|
|
|
ShoutRatingStorage, ShoutViewStorage
|
|
|
|
from orm.base import Base, engine, local_session
|
2022-06-19 17:54:39 +00: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 17:54:39 +00: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 09:14:26 +00:00
|
|
|
Operation.init_table()
|
|
|
|
Resource.init_table()
|
2021-12-10 13:52:55 +00:00
|
|
|
User.init_table()
|
2021-12-08 12:51:30 +00:00
|
|
|
Community.init_table()
|
|
|
|
Role.init_table()
|
2021-09-24 14:39:37 +00:00
|
|
|
|
|
|
|
with local_session() as session:
|
2021-09-29 13:37:08 +00:00
|
|
|
ShoutRatingStorage.init(session)
|
2022-06-19 17:54:39 +00:00
|
|
|
# CommentRatingStorage.init(session)
|
|
|
|
# ProposalRatingStorage.init(session)
|
2021-09-29 12:59:48 +00:00
|
|
|
ShoutViewStorage.init(session)
|
2021-11-24 15:53:01 +00:00
|
|
|
RoleStorage.init(session)
|
2021-11-24 12:56:09 +00:00
|
|
|
UserStorage.init(session)
|
2021-12-12 13:00:38 +00:00
|
|
|
TopicStorage.init(session)
|