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
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ jobs:
PYTHONDEVMODE: 1
PYTEST_ARGS: "-n auto --cov=tortoise --cov-append --cov-branch --tb=native -q"
- name: Upload Coverage
run: |
pip3 install --upgrade coveralls
coveralls --service=github
run: uvx coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
Expand Down
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ _style:
ruff check --fix $(checkfiles)

lint: build _lint
_lint:
$(MAKE) _style
$(MAKE) _codeqc
_lint: _style _codeqc

codeqc: build _typehints
codeqc: build _codeqc
_codeqc:
mypy $(checkfiles)
bandit -c pyproject.toml -r $(checkfiles)
Expand Down Expand Up @@ -101,5 +99,5 @@ build: deps
rm -fR dist/
uv build

publish: deps _build
publish: build
twine upload dist/*
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ The following table shows the available installation options for different datab
Quick Tutorial
--------------

Define the models by inheriting from ``tortoise.models.Model``.
Define the models by inheriting from ``tortoise.Model``.


.. code-block:: python3

from tortoise.models import Model
from tortoise import fields
from tortoise import Model, fields
from tortoise.fields import OnDelete

class Tournament(Model):
id = fields.IntField(primary_key=True)
Expand All @@ -97,8 +97,8 @@ Define the models by inheriting from ``tortoise.models.Model``.
class Event(Model):
id = fields.BigIntField(primary_key=True)
name = fields.TextField()
tournament = fields.ForeignKeyField('models.Tournament', related_name='events', on_delete=fields.OnDelete.CASCADE)
participants = fields.ManyToManyField('models.Team', related_name='events', through='event_team', on_delete=fields.OnDelete.SET_NULL)
tournament = fields.ForeignKeyField('models.Tournament', related_name='events', on_delete=OnDelete.CASCADE)
participants = fields.ManyToManyField('models.Team', related_name='events', through='event_team', on_delete=OnDelete.SET_NULL)


class Team(Model):
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ classifiers = [
"Framework :: AsyncIO",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Database",
"Typing :: Typed",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
Expand Down
Loading