masonite-framework-orm 3.0.2__tar.gz → 3.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {masonite_framework_orm-3.0.2/src/masonite_framework_orm.egg-info → masonite_framework_orm-3.1.0}/PKG-INFO +2 -2
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/setup.py +2 -2
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0/src/masonite_framework_orm.egg-info}/PKG-INFO +2 -2
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masonite_framework_orm.egg-info/SOURCES.txt +0 -2
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masonite_framework_orm.egg-info/requires.txt +1 -1
- masonite_framework_orm-3.1.0/src/masoniteorm/commands/Command.py +173 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/Entry.py +2 -2
- masonite_framework_orm-3.0.2/src/masoniteorm/commands/CanOverrideConfig.py +0 -16
- masonite_framework_orm-3.0.2/src/masoniteorm/commands/CanOverrideOptionsDefault.py +0 -22
- masonite_framework_orm-3.0.2/src/masoniteorm/commands/Command.py +0 -6
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/LICENSE +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/MANIFEST.in +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/README.md +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/pyproject.toml +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/setup.cfg +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masonite_framework_orm.egg-info/dependency_links.txt +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masonite_framework_orm.egg-info/entry_points.txt +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masonite_framework_orm.egg-info/top_level.txt +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/collection/Collection.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/collection/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MakeMigrationCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MakeModelCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MakeModelDocstringCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MakeObserverCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MakeSeedCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MigrateCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MigrateFreshCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MigrateRefreshCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MigrateResetCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MigrateRollbackCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/MigrateStatusCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/SeedRunCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/ShellCommand.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/stubs/create_migration.stub +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/stubs/create_seed.stub +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/stubs/model.stub +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/stubs/observer.stub +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/stubs/table_migration.stub +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/config.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/connections/BaseConnection.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/connections/ConnectionFactory.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/connections/ConnectionResolver.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/connections/MSSQLConnection.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/connections/MySQLConnection.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/connections/PostgresConnection.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/connections/SQLiteConnection.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/connections/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/exceptions.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/expressions/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/expressions/expressions.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/factories/Factory.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/factories/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/helpers/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/helpers/misc.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/migrations/Migration.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/migrations/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/models/MigrationModel.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/models/Model.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/models/Model.pyi +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/models/Pivot.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/models/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/observers/ObservesEvents.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/observers/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/pagination/BasePaginator.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/pagination/LengthAwarePaginator.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/pagination/SimplePaginator.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/pagination/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/providers/ORMProvider.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/providers/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/EagerRelation.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/QueryBuilder.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/grammars/BaseGrammar.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/grammars/MSSQLGrammar.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/grammars/MySQLGrammar.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/grammars/PostgresGrammar.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/grammars/SQLiteGrammar.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/grammars/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/processors/MSSQLPostProcessor.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/processors/MySQLPostProcessor.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/processors/PostgresPostProcessor.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/processors/SQLitePostProcessor.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/processors/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/BaseRelationship.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/BelongsTo.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/BelongsToMany.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/HasMany.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/HasManyThrough.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/HasOne.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/HasOneThrough.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/MorphMany.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/MorphOne.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/MorphTo.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/MorphToMany.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/relationships/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Blueprint.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Column.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/ColumnDiff.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Constraint.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/ForeignKeyConstraint.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Index.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Schema.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Table.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/TableDiff.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/platforms/MSSQLPlatform.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/platforms/MySQLPlatform.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/platforms/Platform.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/platforms/PostgresPlatform.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/platforms/SQLitePlatform.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/platforms/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/BaseScope.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/SoftDeleteScope.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/SoftDeletesMixin.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/TimeStampsMixin.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/TimeStampsScope.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/UUIDPrimaryKeyMixin.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/UUIDPrimaryKeyScope.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/__init__.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/scope.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/seeds/Seeder.py +0 -0
- {masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/seeds/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: masonite-framework-orm
|
|
3
|
-
Version: 3.0
|
|
3
|
+
Version: 3.1.0
|
|
4
4
|
Summary: The Official Masonite ORM
|
|
5
5
|
Home-page: https://github.com/masonitedev/orm
|
|
6
6
|
Author: Joe Mancuso
|
|
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
|
|
|
28
28
|
License-File: LICENSE
|
|
29
29
|
Requires-Dist: inflection<0.6,>=0.3
|
|
30
30
|
Requires-Dist: pendulum<4.0,>=3.0
|
|
31
|
-
Requires-Dist: cleo<2.
|
|
31
|
+
Requires-Dist: cleo<3,>=2.1
|
|
32
32
|
Provides-Extra: test
|
|
33
33
|
Requires-Dist: coverage; extra == "test"
|
|
34
34
|
Requires-Dist: pytest; extra == "test"
|
|
@@ -8,7 +8,7 @@ setup(
|
|
|
8
8
|
# Versions should comply with PEP440. For a discussion on single-sourcing
|
|
9
9
|
# the version across setup.py and the project code, see
|
|
10
10
|
# https://packaging.python.org/en/latest/single_source_version.html
|
|
11
|
-
version="3.0
|
|
11
|
+
version="3.1.0",
|
|
12
12
|
package_dir={"": "src"},
|
|
13
13
|
description="The Official Masonite ORM",
|
|
14
14
|
long_description=long_description,
|
|
@@ -33,7 +33,7 @@ setup(
|
|
|
33
33
|
install_requires=[
|
|
34
34
|
"inflection>=0.3,<0.6",
|
|
35
35
|
"pendulum>=3.0,<4.0",
|
|
36
|
-
"cleo>=
|
|
36
|
+
"cleo>=2.1,<3",
|
|
37
37
|
],
|
|
38
38
|
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
|
39
39
|
classifiers=[
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: masonite-framework-orm
|
|
3
|
-
Version: 3.0
|
|
3
|
+
Version: 3.1.0
|
|
4
4
|
Summary: The Official Masonite ORM
|
|
5
5
|
Home-page: https://github.com/masonitedev/orm
|
|
6
6
|
Author: Joe Mancuso
|
|
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
|
|
|
28
28
|
License-File: LICENSE
|
|
29
29
|
Requires-Dist: inflection<0.6,>=0.3
|
|
30
30
|
Requires-Dist: pendulum<4.0,>=3.0
|
|
31
|
-
Requires-Dist: cleo<2.
|
|
31
|
+
Requires-Dist: cleo<3,>=2.1
|
|
32
32
|
Provides-Extra: test
|
|
33
33
|
Requires-Dist: coverage; extra == "test"
|
|
34
34
|
Requires-Dist: pytest; extra == "test"
|
|
@@ -14,8 +14,6 @@ src/masoniteorm/config.py
|
|
|
14
14
|
src/masoniteorm/exceptions.py
|
|
15
15
|
src/masoniteorm/collection/Collection.py
|
|
16
16
|
src/masoniteorm/collection/__init__.py
|
|
17
|
-
src/masoniteorm/commands/CanOverrideConfig.py
|
|
18
|
-
src/masoniteorm/commands/CanOverrideOptionsDefault.py
|
|
19
17
|
src/masoniteorm/commands/Command.py
|
|
20
18
|
src/masoniteorm/commands/Entry.py
|
|
21
19
|
src/masoniteorm/commands/MakeMigrationCommand.py
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from cleo.commands.command import Command as BaseCommand
|
|
4
|
+
from cleo.helpers import argument, option
|
|
5
|
+
from inflection import underscore
|
|
6
|
+
|
|
7
|
+
_TOKEN_RE = re.compile(r"\{([^}]+)\}")
|
|
8
|
+
_NAME_RE = re.compile(r"[A-Za-z0-9:_\-]+")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Command(BaseCommand):
|
|
12
|
+
"""Masonite ORM's base command.
|
|
13
|
+
|
|
14
|
+
Commands declare their signature in the class docstring using the
|
|
15
|
+
historical cleo 0.8 block format, which this class translates into a
|
|
16
|
+
cleo 2 definition:
|
|
17
|
+
|
|
18
|
+
Description of the command
|
|
19
|
+
|
|
20
|
+
command:name
|
|
21
|
+
{argument : Argument description}
|
|
22
|
+
{optional_argument? : Optional argument}
|
|
23
|
+
{--flag : Boolean option}
|
|
24
|
+
{--s|--long : Option with a shortcut}
|
|
25
|
+
{--option=? : Option expecting a value}
|
|
26
|
+
{--option=default : Option with a default value}
|
|
27
|
+
|
|
28
|
+
Optional option defaults can be overridden when instantiating the
|
|
29
|
+
command: SomeCommand(directory="other/default"). If an option long name
|
|
30
|
+
uses - then use _ in the keyword argument.
|
|
31
|
+
|
|
32
|
+
Every command also gets a global --config/-C option pointing to the ORM
|
|
33
|
+
configuration file.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def __init__(self, **kwargs):
|
|
37
|
+
self._configure_from_docstring()
|
|
38
|
+
super().__init__()
|
|
39
|
+
|
|
40
|
+
# global --config option available on every ORM command
|
|
41
|
+
self._definition.add_option(
|
|
42
|
+
option(
|
|
43
|
+
"config",
|
|
44
|
+
"C",
|
|
45
|
+
"The path to the ORM configuration file. If not given DB_CONFIG_PATH "
|
|
46
|
+
"env variable will be used and finally 'config.database'.",
|
|
47
|
+
flag=False,
|
|
48
|
+
value_required=False,
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
# allow overriding option defaults per instance
|
|
53
|
+
self.overriden_default = kwargs
|
|
54
|
+
for definition_option in self._definition.options:
|
|
55
|
+
default = self.overriden_default.get(underscore(definition_option.name))
|
|
56
|
+
if default:
|
|
57
|
+
definition_option.set_default(default)
|
|
58
|
+
|
|
59
|
+
def option(self, key=None):
|
|
60
|
+
value = super().option(key)
|
|
61
|
+
if value is None and key is not None:
|
|
62
|
+
# cleo 0.8 compatibility: an optional-value option passed without
|
|
63
|
+
# a value (e.g. a bare --show) reads as present, hence truthy.
|
|
64
|
+
try:
|
|
65
|
+
given_options = self.io.input._options
|
|
66
|
+
except AttributeError:
|
|
67
|
+
return value
|
|
68
|
+
if key in given_options:
|
|
69
|
+
return True
|
|
70
|
+
return value
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def _configure_from_docstring(cls):
|
|
74
|
+
# configure each concrete command class once
|
|
75
|
+
if "_docstring_parsed" in cls.__dict__:
|
|
76
|
+
return
|
|
77
|
+
doc = cls.__doc__ or ""
|
|
78
|
+
|
|
79
|
+
name, description = cls._parse_name_and_description(doc)
|
|
80
|
+
arguments, options = cls._parse_tokens(doc)
|
|
81
|
+
|
|
82
|
+
if name:
|
|
83
|
+
cls.name = name
|
|
84
|
+
if description:
|
|
85
|
+
cls.description = description
|
|
86
|
+
cls.arguments = arguments
|
|
87
|
+
cls.options = options
|
|
88
|
+
cls._docstring_parsed = True
|
|
89
|
+
|
|
90
|
+
@staticmethod
|
|
91
|
+
def _parse_name_and_description(doc):
|
|
92
|
+
"""The command name is the last text line that looks like a command
|
|
93
|
+
slug; every text line before it forms the description."""
|
|
94
|
+
text_lines = [
|
|
95
|
+
line.strip()
|
|
96
|
+
for line in _TOKEN_RE.sub("", doc).splitlines()
|
|
97
|
+
if line.strip()
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
name = None
|
|
101
|
+
name_index = None
|
|
102
|
+
for index, line in enumerate(text_lines):
|
|
103
|
+
if _NAME_RE.fullmatch(line):
|
|
104
|
+
name = line
|
|
105
|
+
name_index = index
|
|
106
|
+
|
|
107
|
+
description_lines = (
|
|
108
|
+
text_lines[:name_index] if name_index is not None else text_lines
|
|
109
|
+
)
|
|
110
|
+
return name, " ".join(description_lines)
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def _parse_tokens(cls, doc):
|
|
114
|
+
arguments = []
|
|
115
|
+
options = []
|
|
116
|
+
for token in _TOKEN_RE.findall(doc):
|
|
117
|
+
spec, _, token_description = token.strip().partition(":")
|
|
118
|
+
spec = spec.strip()
|
|
119
|
+
token_description = token_description.strip() or None
|
|
120
|
+
|
|
121
|
+
if spec.startswith("--"):
|
|
122
|
+
options.append(cls._parse_option(spec, token_description))
|
|
123
|
+
else:
|
|
124
|
+
arguments.append(cls._parse_argument(spec, token_description))
|
|
125
|
+
return arguments, options
|
|
126
|
+
|
|
127
|
+
@staticmethod
|
|
128
|
+
def _parse_option(spec, description):
|
|
129
|
+
parts = [part.strip().lstrip("-") for part in spec.split("|")]
|
|
130
|
+
short_name = parts[0] if len(parts) > 1 else None
|
|
131
|
+
long_name = parts[-1]
|
|
132
|
+
|
|
133
|
+
flag = True
|
|
134
|
+
multiple = False
|
|
135
|
+
default = None
|
|
136
|
+
if "=" in long_name:
|
|
137
|
+
long_name, _, default = long_name.partition("=")
|
|
138
|
+
flag = False
|
|
139
|
+
if default == "*":
|
|
140
|
+
multiple = True
|
|
141
|
+
default = None
|
|
142
|
+
elif default in ("?", ""):
|
|
143
|
+
default = None
|
|
144
|
+
|
|
145
|
+
return option(
|
|
146
|
+
long_name,
|
|
147
|
+
short_name,
|
|
148
|
+
description,
|
|
149
|
+
flag=flag,
|
|
150
|
+
value_required=False,
|
|
151
|
+
multiple=multiple,
|
|
152
|
+
default=default,
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
@staticmethod
|
|
156
|
+
def _parse_argument(spec, description):
|
|
157
|
+
optional = False
|
|
158
|
+
multiple = False
|
|
159
|
+
default = None
|
|
160
|
+
if spec.endswith("?"):
|
|
161
|
+
spec = spec[:-1]
|
|
162
|
+
optional = True
|
|
163
|
+
elif spec.endswith("*"):
|
|
164
|
+
spec = spec[:-1]
|
|
165
|
+
optional = True
|
|
166
|
+
multiple = True
|
|
167
|
+
elif "=" in spec:
|
|
168
|
+
spec, _, default = spec.partition("=")
|
|
169
|
+
optional = True
|
|
170
|
+
|
|
171
|
+
return argument(
|
|
172
|
+
spec, description, optional=optional, multiple=multiple, default=default
|
|
173
|
+
)
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/Entry.py
RENAMED
|
@@ -5,7 +5,7 @@ This can be used by running "python craft". This module is not ran when the CLI
|
|
|
5
5
|
successfully import commands for you.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
from cleo import Application
|
|
8
|
+
from cleo.application import Application
|
|
9
9
|
|
|
10
10
|
from . import (
|
|
11
11
|
MakeMigrationCommand,
|
|
@@ -23,7 +23,7 @@ from . import (
|
|
|
23
23
|
ShellCommand,
|
|
24
24
|
)
|
|
25
25
|
|
|
26
|
-
application = Application("ORM Version:", 0.1)
|
|
26
|
+
application = Application("ORM Version:", "0.1")
|
|
27
27
|
|
|
28
28
|
application.add(MigrateCommand())
|
|
29
29
|
application.add(MigrateRollbackCommand())
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from cleo import Command
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class CanOverrideConfig(Command):
|
|
5
|
-
def __init__(self):
|
|
6
|
-
super().__init__()
|
|
7
|
-
self.add_option()
|
|
8
|
-
|
|
9
|
-
def add_option(self):
|
|
10
|
-
# 8 is the required flag constant in cleo
|
|
11
|
-
self._config.add_option(
|
|
12
|
-
"config",
|
|
13
|
-
"C",
|
|
14
|
-
8,
|
|
15
|
-
description="The path to the ORM configuration file. If not given DB_CONFIG_PATH env variable will be used and finally 'config.database'.",
|
|
16
|
-
)
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
from inflection import underscore
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class CanOverrideOptionsDefault:
|
|
5
|
-
"""Command mixin to allow to override optional argument default values when instantiating the
|
|
6
|
-
command.
|
|
7
|
-
Example: SomeCommand(app, option1="other/default").
|
|
8
|
-
|
|
9
|
-
If an argument long name is using - then use _ in keyword argument:
|
|
10
|
-
Example: SomeCommand(app, option_1="other/default") for an option named in option-1
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
def __init__(self, **kwargs):
|
|
14
|
-
super().__init__()
|
|
15
|
-
self.overriden_default = kwargs
|
|
16
|
-
for option_name, option in self.config.options.items():
|
|
17
|
-
# Cleo does not authorize _ in option name but - are authorized and unfortunately -
|
|
18
|
-
# cannot be used in Python variables. So underscore() is called to make sure that
|
|
19
|
-
# an option like 'option-a' will be accessible with 'option_a' in kwargs
|
|
20
|
-
default = self.overriden_default.get(underscore(option_name))
|
|
21
|
-
if default:
|
|
22
|
-
option.set_default(default)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/collection/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/factories/Factory.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/factories/__init__.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/helpers/__init__.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/helpers/misc.py
RENAMED
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/models/Model.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/models/Model.pyi
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/models/Pivot.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/models/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/observers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/pagination/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/providers/__init__.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/EagerRelation.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/QueryBuilder.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/query/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Blueprint.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Column.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/ColumnDiff.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Constraint.py
RENAMED
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Index.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Schema.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/Table.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/TableDiff.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/schema/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/BaseScope.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/__init__.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/scopes/scope.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/seeds/Seeder.py
RENAMED
|
File without changes
|
{masonite_framework_orm-3.0.2 → masonite_framework_orm-3.1.0}/src/masoniteorm/seeds/__init__.py
RENAMED
|
File without changes
|