Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Jan 12, 2024
1 parent 662dede commit eec2c43
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = "dfsdgf45sdf1"# TODO : Change it !!!
revision = "dfsdgf45sdf1" # TODO : Change it !!!
down_revision = None
branch_labels = "{{cookiecutter.module_name}}"
depends_on = "modulator"
Expand All @@ -29,7 +29,11 @@ def upgrade():
sa.Column("id_post", sa.Integer, primary_key=True),
sa.Column("post_title", sa.String),
sa.Column("post_content", sa.String),
sa.Column("id_author", sa.Integer, sa.ForeignKey("{{cookiecutter.db_schema_name}}.author.id_author")),
sa.Column(
"id_author",
sa.Integer,
sa.ForeignKey("{{cookiecutter.db_schema_name}}.author.id_author"),
),
schema="{{cookiecutter.db_schema_name}}",
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from geonature.utils.env import db


class Author(db.Model):
___tablename__ = "author"
__table_args__ = {"schema": "{{cookiecutter.db_schema_name}}"}
Expand All @@ -18,6 +19,8 @@ class Post(db.Model):
post_title = db.Column(db.String)
post_content = db.Column(db.String)
id_author = db.Column(
db.Integer, db.ForeignKey("{{cookiecutter.db_schema_name}}.author.id_author"), nullable=False
db.Integer,
db.ForeignKey("{{cookiecutter.db_schema_name}}.author.id_author"),
nullable=False,
)
author = db.relationship(Author, back_populates="posts")

0 comments on commit eec2c43

Please sign in to comment.