Skip to content

Commit c4959b4

Browse files
Merge pull request #939 from circulon/feature/2.0_to_3.0
Transition 2.0 to 3.0
2 parents a94de59 + 18ee0f7 commit c4959b4

File tree

162 files changed

+5466
-2089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+5466
-2089
lines changed

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
use asdf
2+
layout python

.github/workflows/pythonapp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
python-version: ${{ matrix.python-version }}
4141
- name: Install dependencies
4242
run: |
43-
make init
43+
make init-ci
4444
- name: Test with pytest
4545
env:
4646
POSTGRES_DATABASE_HOST: localhost
@@ -68,6 +68,6 @@ jobs:
6868
python-version: 3.12
6969
- name: Install Flake8
7070
run: |
71-
pip install flake8==3.7.9
71+
pip install flake8-pyproject
7272
- name: Lint
7373
run: make lint

.github/workflows/pythonpublish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
python-version: ${{ matrix.python-version }}
4343
- name: Install dependencies
4444
run: |
45-
make init
45+
make init-ci
4646
- name: Test with Pytest and Publish to PYPI
4747
env:
4848
POSTGRES_DATABASE_HOST: localhost

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
venv
2+
.direnv
23
.python-version
34
.vscode
45
.pytest_*
@@ -15,4 +16,7 @@ htmlcov/*
1516
coverage.xml
1617
.coverage
1718
*.log
18-
build
19+
build
20+
/orm.sqlite3
21+
/.bootstrapped-pip
22+
/.ignore-pre-commit

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
repos:
2+
- repo: https://github.com/pycqa/isort
3+
rev: 6.0.1
4+
hooks:
5+
- id: isort
6+
args: [--profile=black]
7+
exclude: |
8+
(?x)(
9+
^build|
10+
^conda
11+
)
12+
13+
- repo: https://github.com/psf/black
14+
rev: 25.1.0
15+
hooks:
16+
- id: black
17+
exclude: |
18+
(?x)(
19+
^build|
20+
^conda
21+
)
22+
23+
- repo: https://github.com/pycqa/flake8
24+
rev: 7.1.2
25+
hooks:
26+
- id: flake8
27+
additional_dependencies: [flake8-pyproject]
28+
exclude: |
29+
(?x)(
30+
^build|
31+
^conda
32+
)

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python 3.8.10

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Change Log
2+
3+
## [3.0.0] - 2025-03-30
4+
5+
### Changed
6+
7+
- Model `create` now always checks for cast values
8+
- `pendulum` version upgrade
9+
10+
#### Breaking Changes
11+
12+
- Changed raw expressions placeholder from requiringing explicit quoring per grammar (like this '?') to automaic (like this ?)
13+
- Changed `update` and `delete` methods to return the affected rows instead of the model
14+
- Seeding depencies are now in a separate`[seeder]` extension
15+
- `Factory` class must now be imported from the sub-package `masoniteorm.factories`
16+
17+
### Fixed
18+
19+
- Model `update` and `delete` not casting passed values
20+
21+
22+
## [2.24.0] - 2025-01-23
23+
24+
### Added
25+
26+
- allow override of model default selects
27+
28+
## [2.23.2] - 2024-11-29
29+
30+
## Added
31+
32+
- Ability so specify default select criteria for Models
33+
- Add connection pooling to MySQL and Postgres
34+
- PostgresConnection supports SSL and TLS options
35+
36+
## Fixed
37+
38+
- `.on_null` and `.on_not_null` had to be last criteria
39+
- Find cannot use scopes
40+
- Fix `has_one_through` relationship not working
41+
- Tests parameter `query=True` should return query builder
42+
- Fix `has_many_through` relationship not working
43+
- Fixed nested relations
44+
45+
## [2.23.1] - 2024-10-22
46+
47+
Maintenance release
48+
49+
## [2.23.0] - 2024-10-19
50+
51+
## Added
52+
53+
- Updated tests

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you are interested in the project then it would be a great idea to read the "
1212

1313
## Issues
1414

15-
Everything really should start with opening an issue or finding an issue. If you feel you have an idea for how the project can be improved, no matter how small, you should open an issue so we can have an open dicussion with the maintainers of the project.
15+
Everything really should start with opening an issue or finding an issue. If you feel you have an idea for how the project can be improved, no matter how small, you should open an issue so we can have an open discussion with the maintainers of the project.
1616

1717
We can discuss in that issue the solution to the problem or feature you have. If we do not feel it fits within the project then we will close the issue. Feel free to open a new issue if new information comes up.
1818

cc.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,22 @@
1616
# print(builder.where("id", 1).or_where(lambda q: q.where('id', 2).or_where('id', 3)).get())
1717

1818
class User(Model):
19-
__connection__ = "sqlite"
19+
__connection__ = "t"
2020
__table__ = "users"
21+
__dates__ = ["verified_at"]
2122

2223
@has_many("id", "user_id")
2324
def articles(self):
2425
return Article
25-
class Article(Model):
26+
class Company(Model):
2627
__connection__ = "sqlite"
2728

2829

2930
# user = User.create({"name": "phill", "email": "phill"})
3031
# print(inspect.isclass(User))
31-
print(User.find(1).with_("articles").first().serialize())
32+
user = User.first()
33+
# user.update({"verified_at": None, "updated_at": None})
34+
print(user.serialize())
3235

3336
# print(user.serialize())
3437
# print(User.first())

config/test-database.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from src.masoniteorm.connections import ConnectionResolver
2+
3+
DATABASES = {
4+
"default": "mysql",
5+
"mysql": {
6+
"host": "127.0.0.1",
7+
"driver": "mysql",
8+
"database": "masonite",
9+
"user": "root",
10+
"password": "",
11+
"port": 3306,
12+
"log_queries": False,
13+
"options": {
14+
#
15+
}
16+
},
17+
"postgres": {
18+
"host": "127.0.0.1",
19+
"driver": "postgres",
20+
"database": "masonite",
21+
"user": "root",
22+
"password": "",
23+
"port": 5432,
24+
"log_queries": False,
25+
"options": {
26+
#
27+
}
28+
},
29+
"sqlite": {
30+
"driver": "sqlite",
31+
"database": "masonite.sqlite3",
32+
}
33+
}
34+
35+
DB = ConnectionResolver().set_connection_details(DATABASES)

0 commit comments

Comments
 (0)