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 87be6ea

Browse filesBrowse files
committed
Simplify Optional class
1 parent 4df65cd commit 87be6ea
Copy full SHA for 87be6ea

File tree

Expand file treeCollapse file tree

1 file changed

+7
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-6
lines changed

‎python.json

Copy file name to clipboardExpand all lines: python.json
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@
6161
"prefix": "freenitsql",
6262
"body": [
6363
"import ormar",
64-
"from freenit.models.sql.base import (",
65-
" OrmarBaseModel,",
66-
" generate_optional,",
67-
" ormar_config,",
68-
")",
64+
"from freenit.models.sql.base import OrmarBaseModel, make_optional, ormar_config",
6965
"",
7066
"",
7167
"class ${1}(OrmarBaseModel):",
@@ -74,7 +70,12 @@
7470
" id = ormar.Integer(primary_key=True)",
7571
" ${0}",
7672
"",
77-
"${1}Optional = generate_optional(${1})"
73+
"",
74+
"class ${1}Optional(${1}):",
75+
" pass",
76+
"",
77+
"",
78+
"make_optional(${1}Optional)"
7879
],
7980
"description": "Freenit model using Ormar"
8081
},

0 commit comments

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