bluelog icon indicating copy to clipboard operation
bluelog copied to clipboard

A blog engine built with Flask.

Results 8 bluelog issues
Sort by recently updated
recently updated
newest added

在生成50条回复时用到 `replied=Comment.query.get(random.randint(1, Comment.query.count())), post=Post.query.get(random.randint(1, Post.query.count()))` 这样会不会导致生成的replied并不是生成的post的的comment呢?

1. 主页每篇文章显示的评论数是这篇文章下的所有评论(包括未审核通过的), 主要代码如下: ```python {{ post.comments|length }} ``` 2. 文章详情页面显示的评论数是分页后当前页面的评论数, 而不是文章的总评论数, 主要的代码如下: ```python post = Post.query.get_or_404(post_id) page = request.args.get('page', 1, type=int) per_page = current_app.config['BLUELOG_COMMENT_PER_PAGE'] pagination = Comment.query.with_parent(post).filter_by(reviewed=True).order_by(Comment.timestamp.asc()).paginate(page, per_page) comments =...

improvement

按照您在admin.py中原有的写法,所有的edit_xxx function在表单验证未通过时,已做的修改在html表单上都无法保留。 建议修改成以下写法: ```python @admin_bp.route('/link//edit', methods=['GET', 'POST']) @login_required def edit_link(link_id): link = Link.query.get_or_404(link_id) form = LinkForm(request.form) if request.method == "GET": form.name.data = link.name form.url.data = link.url else: if form.validate_on_submit(): link.name...

当 在/admin/post/manage URL中最后一页删除最后一个条目时会出现PAGE NOT FOUND。 修改如下 : @admin_bp.route('/post/manage') @login_required def manage_post(): page = request.args.get('page', 1, type=int) pages = Post.query.paginate(page=1, per_page=current_app.config['BLUELOG_MANAGE_POST_PER_PAGE']).pages if page > pages: page = pages return redirect(url_for('.manage_post', page=page))...

bug

在本地测试环境下上传带图文本后保存,再删除post,发现一同上传的图片没有被删除,不知道在哪里能找到或生成这些图片的索引呢?

对「邻接列表关系」理解上还有一些问题,希望老师解惑 `models.py` 中这三行代码我的理解如下: ```python # comment.replied_id 为一个指向评论(父级,也是自身)的外键 replied_id = db.Column(db.Integer, db.ForeignKey('comment.id')) # comment.replies 为同一评论下的所有“回复”(子级,因为「多」所以变量名采用了复数形式) replies = db.relationship('Comment', back_populates='replied', cascade='all, delete-orphan') # comment.replied 为被回复的评论(父级,也是「一」这一侧的关系定义) replied = db.relationship('Comment', back_populates='replies', remote_side=[id]) ``` 之所以有第三行(replied)是「一」这一侧必须要有关系定义,从而SQLAlchemy才能到对应的「多」侧去找外键字段(replied_id)。...

Bumps [mako](https://github.com/sqlalchemy/mako) from 1.1.2 to 1.2.2. Release notes Sourced from mako's releases. 1.2.2 Released: Mon Aug 29 2022 bug [bug] [lexer] Fixed issue in lexer where the regexp used to...

dependencies

Bumps [gunicorn](https://github.com/benoitc/gunicorn) from 20.0.4 to 22.0.0. Release notes Sourced from gunicorn's releases. Gunicorn 22.0 has been released Gunicorn 22.0.0 has been released. This version fix the numerous security vulnerabilities. You're...

dependencies