Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4c4c716c
authored
Jan 02, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
template
1 parent
62c38f60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
opensipkd/models/base.py
opensipkd/models/base.py
View file @
4c4c716
...
...
@@ -11,6 +11,7 @@ from zope.sqlalchemy import register
_logging
=
logging
.
getLogger
(
__name__
)
class
MySession
(
Session
):
def
execute
(
self
,
clause
,
params
=
None
,
mapper
=
None
,
**
kw
):
# Your magic with clause here
...
...
@@ -68,7 +69,8 @@ class CommonModel(object):
def
from_dict
(
self
,
values
,
date_format
=
"
%
d-
%
m-
%
Y"
):
for
column
in
self
.
__table__
.
columns
:
if
column
.
name
in
values
:
_logging
.
debug
(
f
"{column.name}: {column.type}: {values[column.name]}"
)
_logging
.
debug
(
f
"{column.name}: {column.type}: {values[column.name]}"
)
if
type
(
column
.
type
)
is
DateTime
and
date_format
:
if
values
[
column
.
name
]
and
type
(
values
[
column
.
name
])
is
String
:
setattr
(
self
,
column
.
name
,
...
...
@@ -220,4 +222,4 @@ class NamaModel(KodeModel):
@classmethod
def
get_list
(
cls
):
return
cls
.
query_list
()
.
all
()
\ No newline at end of file
return
cls
.
query_list
()
.
all
()
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment