2021-11-24 15:53:01 +00:00
|
|
|
from orm.rbac import Operation, Resource, Permission, Role, RoleStorage
|
2021-08-28 10:13:50 +00:00
|
|
|
from orm.community import Community
|
2021-11-24 12:56:09 +00:00
|
|
|
from orm.user import User, UserRating, UserRole, UserStorage
|
2021-07-13 10:14:48 +00:00
|
|
|
from orm.message import Message
|
2021-10-28 10:42:34 +00:00
|
|
|
from orm.topic import Topic, TopicSubscription
|
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
|
2021-10-12 19:38:12 +00:00
|
|
|
from orm.comment import Comment, CommentRating
|
2021-07-13 10:14:48 +00:00
|
|
|
|
2021-11-24 13:34:30 +00:00
|
|
|
__all__ = ["User", "Role", "Community", "Operation", "Permission", "Message", "Shout", "Topic", "TopicSubscription", "Notification", "ShoutRating", "Comment", "CommentRating", "UserRating"]
|
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-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)
|
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)
|