Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 984b197

Browse filesBrowse files
committed
New ormar
1 parent 6646dbe commit 984b197
Copy full SHA for 984b197

File tree

Expand file treeCollapse file tree

1 file changed

+3
-11
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-11
lines changed

‎python.json

Copy file name to clipboardExpand all lines: python.json
+3-11Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,16 @@
6161
"body": [
6262
"import ormar",
6363
"",
64-
"from freenit.config import getConfig",
65-
"",
66-
"from freenit.models.metaclass import AllOptional",
67-
"from freenit.models.ormar.base import OrmarBaseModel",
68-
"",
69-
"config = getConfig()",
64+
"from freenit.models.ormar.base import OrmarBaseModel, generate_optional, ormar_config",
7065
"",
7166
"",
7267
"class ${1}(OrmarBaseModel):",
73-
" class Meta(config.meta):",
74-
" pass",
68+
" ormar_config = ormar_config.copy()",
7569
"",
7670
" id: int = ormar.Integer(primary_key=True)",
7771
" ${0}",
7872
"",
79-
"",
80-
"class ${1}Optional(${1}, metaclass=AllOptional):",
81-
" pass"
73+
"${1}Optional = generate_optional(${1})"
8274
],
8375
"description": "Freenit model using Ormar"
8476
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.