+ {{ _("Do you recommend this %(type)s?", type=package.type.value | lower) }} +
+ + {% set review_url = url_for('packages.review', author=package.author.username, name=package.name) %} + + +Package: {{ thread.package.title }}
++ Package: {{ thread.package.title }} +
{% endif %} {% if thread.private %} diff --git a/migrations/versions/4f2e19bc2a27_.py b/migrations/versions/4f2e19bc2a27_.py new file mode 100644 index 00000000..0b760fcb --- /dev/null +++ b/migrations/versions/4f2e19bc2a27_.py @@ -0,0 +1,40 @@ +"""empty message + +Revision ID: 4f2e19bc2a27 +Revises: dd27f1311a90 +Create Date: 2020-07-09 00:35:35.066719 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '4f2e19bc2a27' +down_revision = 'dd27f1311a90' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('package_review', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('package_id', sa.Integer(), nullable=True), + sa.Column('author_id', sa.Integer(), nullable=False), + sa.Column('recommends', sa.Boolean(), nullable=False), + sa.ForeignKeyConstraint(['author_id'], ['user.id'], ), + sa.ForeignKeyConstraint(['package_id'], ['package.id'], ), + sa.PrimaryKeyConstraint('id') + ) + op.add_column('thread', sa.Column('review_id', sa.Integer(), nullable=True)) + op.create_foreign_key(None, 'thread', 'package_review', ['review_id'], ['id']) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint(None, 'thread', type_='foreignkey') + op.drop_column('thread', 'review_id') + op.drop_table('package_review') + # ### end Alembic commands ###
+ {{ review.thread.title }} +
+ + {{ reply.comment | markdown }} + + + + {{ _("%(num)d comments", num=review.thread.replies.count() - 1) }} + +