Skip to content

Commit 6208619

Browse files
committed
So fussy!! Updated based on CircleCi feedback from Black reformatter
1 parent 031b8f9 commit 6208619

File tree

5 files changed

+12
-30
lines changed

5 files changed

+12
-30
lines changed

python-sqlite-sqlalchemy/project/build_data/build_author_book_publisher_sqlite.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,13 @@ def main():
7070

7171
# get the author/book/publisher data into a dictionary structure
7272
csv_filepath = resource_filename(
73-
"project.data",
74-
"author_book_publisher.csv"
73+
"project.data", "author_book_publisher.csv"
7574
)
7675
author_book_publisher_data = get_author_book_publisher_data(csv_filepath)
7776

7877
# get the filepath to the database file
7978
sqlite_filepath = resource_filename(
80-
"project.data",
81-
"author_book_publisher.db"
79+
"project.data", "author_book_publisher.db"
8280
)
8381

8482
# does the database exist?

python-sqlite-sqlalchemy/project/examples/example_5/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ def main():
185185

186186
# connect to the sqlite database
187187
sqlite_filepath = resource_filename(
188-
"project.data",
189-
"author_book_publisher.db"
188+
"project.data", "author_book_publisher.db"
190189
)
191190
connection = sqlite3.connect(sqlite_filepath)
192191

python-sqlite-sqlalchemy/project/examples/example_6/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ def main():
158158

159159
# Connect to the database using SqlAlchemy
160160
sqlite_filepath = resource_filename(
161-
"project.data",
162-
"author_book_publisher.db"
161+
"project.data", "author_book_publisher.db"
163162
)
164163
engine = create_engine(f"sqlite:///{sqlite_filepath}")
165164
Session = sessionmaker()

python-sqlite-sqlalchemy/project/modules/models.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,9 @@ class Author(Base):
2424
author_id = Column(Integer, primary_key=True)
2525
fname = Column(String)
2626
lname = Column(String)
27-
books = relationship(
28-
"Book",
29-
backref=backref("author")
30-
)
27+
books = relationship("Book", backref=backref("author"))
3128
publishers = relationship(
32-
"Publisher",
33-
secondary=author_publisher,
34-
back_populates="authors"
29+
"Publisher", secondary=author_publisher, back_populates="authors"
3530
)
3631

3732

@@ -41,9 +36,7 @@ class Book(Base):
4136
author_id = Column(Integer, ForeignKey("author.author_id"))
4237
title = Column(String)
4338
publishers = relationship(
44-
"Publisher",
45-
secondary=book_publisher,
46-
back_populates="books"
39+
"Publisher", secondary=book_publisher, back_populates="books"
4740
)
4841

4942

@@ -52,12 +45,8 @@ class Publisher(Base):
5245
publisher_id = Column(Integer, primary_key=True)
5346
name = Column(String)
5447
authors = relationship(
55-
"Author",
56-
secondary=author_publisher,
57-
back_populates="publishers"
48+
"Author", secondary=author_publisher, back_populates="publishers"
5849
)
5950
books = relationship(
60-
"Book",
61-
secondary=book_publisher,
62-
back_populates="publishers"
51+
"Book", secondary=book_publisher, back_populates="publishers"
6352
)

python-sqlite-sqlalchemy/setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
from setuptools import setup, find_packages
22

33
setup(
4-
name='project',
5-
version='1.0',
4+
name="project",
5+
version="1.0",
66
packages=find_packages(),
7-
install_requires=[
8-
"SQLAlchemy",
9-
"treelib"
10-
]
7+
install_requires=["SQLAlchemy", "treelib"],
118
)

0 commit comments

Comments
 (0)