Flaskbb开发过程记录(一)
Forum Models学习
- *外键
类名 | 字段 | 方法 |
---|---|---|
Category | id title description forums(一对多关联Forum) | delete get_all get_forums |
Forum | id category_id title description position locked show_moderators external post_count topic_count last_post_id last_post(一对一关联Post) last_post_user_id last_post_user(一对一关联User) last_post_title last_post_username last_post_created topics(一对多关联topics) moderators(版主;多对多关联;中间表字段为user_id和forum_id) groups(多对多关联;中间表字段为group_id和forum_id) | update_last_post update_read recalculate save delete move_topics_to get_forum get_topics |
Topic | id forum_id* title user_id* username date_created last_updated locked important views post_count first_post_id* first_post(一对一关联Post) last_post_id* last_post(一对一关联Post) posts(一对多关联Post) | is_first_post first_unread get_topic tracker_needs_update update_read recalculate move save delete hide unhide involved_users |
Post | id topic_id* user_id* username content date_created date_modified modified_by | is_first_post save delete hide unhide |
Report | id reporter_id* reported post_id* zapped zapped_by* reason post(一对多关联Post) reporter(一对多关联User) zapper(一对多关联User) | save |
TopicsRead | user_id* user(一对多关联User) topic_id* topic(一对多关联Topic) forum_id* forum(一对多关联Forum) last_read | - |
ForumsRead | user_id* user(一对多关联User) forum_id* forum(一对多关联Forum) last_read cleared | - |