Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-toml
Expand All @@ -12,18 +12,18 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.20.0
hooks:
- id: pyupgrade
args:
- --py38-plus
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
rev: v0.12.10
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 25.1.0
hooks:
- id: black
6 changes: 3 additions & 3 deletions examples/flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

db = SQLAlchemy(engine_options={"echo": True})
app = Flask(__name__)
app.config[
"SQLALCHEMY_DATABASE_URI"
] = "sqlite:////tmp/example.db?check_same_thread=False"
app.config["SQLALCHEMY_DATABASE_URI"] = (
"sqlite:////tmp/example.db?check_same_thread=False"
)
db.init_app(app)


Expand Down
6 changes: 3 additions & 3 deletions sqlalchemy_file/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__version__ = "0.6.0"

from .file import File as File # noqa
from .types import FileField as FileField # noqa
from .types import ImageField as ImageField # noqa
from .file import File as File
from .types import FileField as FileField
from .types import ImageField as ImageField
2 changes: 1 addition & 1 deletion sqlalchemy_file/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def save_file(
if (
container.driver.name == LOCAL_STORAGE_DRIVER_NAME
and extra is not None
and extra.get("meta_data", None) is not None
and extra.get("meta_data") is not None
):
"""
Libcloud local storage driver doesn't support metadata, so the metadata
Expand Down
6 changes: 1 addition & 5 deletions tests/test_multiple_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ class Attachment(Base):
multiple_content = Column(FileField(multiple=True))

def __repr__(self):
return "<Attachment: id {} ; name: {}; multiple_content {}>".format(
self.id,
self.name,
self.multiple_content,
) # pragma: no cover
return f"<Attachment: id {self.id} ; name: {self.name}; multiple_content {self.multiple_content}>" # pragma: no cover


class TestMultipleField:
Expand Down
7 changes: 1 addition & 6 deletions tests/test_result_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ class Attachment(Base):
)

def __repr__(self):
return "<Attachment: id {} ; name: {}; content {}; multiple_content {}>".format(
self.id,
self.name,
self.content,
self.multiple_content,
) # pragma: no cover
return f"<Attachment: id {self.id} ; name: {self.name}; content {self.content}; multiple_content {self.multiple_content}>" # pragma: no cover


class TestResultValue:
Expand Down
7 changes: 1 addition & 6 deletions tests/test_single_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ class Attachment(Base):
article_id = Column(Integer, ForeignKey("article.id"))

def __repr__(self):
return "<Attachment: id {} ; name: {}; content {}; article_id {}>".format(
self.id,
self.name,
self.content,
self.article_id,
) # pragma: no cover
return f"<Attachment: id {self.id} ; name: {self.name}; content {self.content}; article_id {self.article_id}>" # pragma: no cover


class Article(Base):
Expand Down
Loading