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 dc7ed464
authored
Jul 11, 2026
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Migrasi ke deform 3
1 parent
158e195c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
opensipkd/base/widgets/widget_os.py
opensipkd/detable/detable.py
opensipkd/detable/widget.py
opensipkd/base/widgets/widget_os.py
View file @
dc7ed46
from
pyramid.csrf
import
new_csrf_token
,
get_csrf_token
from
iso8601.iso8601
import
ISO8601_REGEX
from
deform.widget
import
string_types
#
from deform.widget import string_types
import
json
import
logging
from
colander
import
SchemaNode
,
null
,
Mapping
,
Invalid
# , string_types
# from colander import compat # tidak ada di colander 2.0
from
deform
import
widget
from
deform.compat
import
sequence_types
,
text_type
,
text_
#
from deform.compat import sequence_types, text_type, text_
from
deform.form
import
Button
from
deform.i18n
import
_
from
deform.widget
import
(
...
...
@@ -257,12 +257,12 @@ class AutocompleteMsInputWidget(AutocompleteInputWidget):
readonly
=
kw
.
get
(
"readonly"
,
self
.
readonly
)
options
=
{}
if
isinstance
(
self
.
values
,
str
ing_types
):
if
isinstance
(
self
.
values
,
str
):
options
[
"remote"
]
=
"
%
s?term=
%%
QUERY"
%
self
.
values
else
:
# vals = []
# for v in self.values:
# if not isinstance(v, str
ing_types
):
# if not isinstance(v, str):
# vals.append(v[1])
# if not vals:
# vals = self.values
...
...
@@ -394,7 +394,7 @@ class CaptchaWidget(Widget):
def
deserialize
(
self
,
field
,
pstruct
):
if
pstruct
is
null
:
return
null
elif
not
isinstance
(
pstruct
,
str
ing_types
):
elif
not
isinstance
(
pstruct
,
str
):
raise
Invalid
(
field
.
schema
,
"Pstruct is not a string"
)
if
self
.
strip
:
pstruct
=
pstruct
.
strip
()
...
...
@@ -460,7 +460,7 @@ class ImageWidget(Widget):
def
deserialize
(
self
,
field
,
pstruct
):
if
pstruct
is
null
:
return
null
elif
not
isinstance
(
pstruct
,
str
ing_types
):
elif
not
isinstance
(
pstruct
,
str
):
raise
Invalid
(
field
.
schema
,
"Pstruct is not a string"
)
if
self
.
strip
:
pstruct
=
pstruct
.
strip
()
...
...
@@ -540,7 +540,7 @@ class MapWidget(Widget):
def
deserialize
(
self
,
field
,
pstruct
):
if
pstruct
is
null
:
return
null
elif
not
isinstance
(
pstruct
,
str
ing_types
):
elif
not
isinstance
(
pstruct
,
str
):
raise
Invalid
(
field
.
schema
,
"Pstruct is not a string"
)
if
self
.
strip
:
pstruct
=
pstruct
.
strip
()
...
...
@@ -622,7 +622,7 @@ class MapWidget(Widget):
# def deserialize(self, field, pstruct):
# if pstruct is null:
# return null
# elif not isinstance(pstruct, str
ing_types
):
# elif not isinstance(pstruct, str):
# raise Invalid(field.schema, "Pstruct is not a string")
# if self.strip:
# pstruct = pstruct.strip()
...
...
@@ -834,7 +834,7 @@ class TextInputWidget(widget.TextInputWidget):
def
__init__
(
self
,
**
kw
):
super
(
TextInputWidget
,
self
)
.
__init__
(
**
kw
)
# if isinstance(self.button, compat.str
ing_types
):
# if isinstance(self.button, compat.str):
if
self
.
button
:
if
isinstance
(
self
.
button
,
str
):
self
.
button
=
Button
(
self
.
button
,
type
=
"button"
)
...
...
@@ -973,7 +973,7 @@ class FilterWidget(Widget):
# readonly = kw.get("readonly", self.readonly)
#
# options = {}
# if isinstance(self.values, str
ing_types
):
# if isinstance(self.values, str):
# options["remote"] = "%s?term=%%QUERY" % self.values
# else:
# options["local"] = self.values
...
...
@@ -1003,7 +1003,7 @@ class CSRFWidget(widget.HiddenWidget):
cstruct
=
get_csrf_token
(
request
)
if
pstruct
is
null
:
return
null
elif
not
isinstance
(
pstruct
,
str
ing_types
):
elif
not
isinstance
(
pstruct
,
str
):
raise
Invalid
(
field
.
schema
,
"Pstruct is not a string"
)
if
not
pstruct
:
return
null
...
...
opensipkd/detable/detable.py
View file @
dc7ed46
...
...
@@ -6,13 +6,17 @@ import re
import
colander
# import deform
from
deform
import
compat
,
widget
as
deform_widget
,
field
from
deform
import
widget
as
deform_widget
,
field
# compat,
from
.
import
widget
log
=
logging
.
getLogger
(
__name__
)
sequence_types
=
(
list
,
tuple
,
range
,
)
class
DeTable
(
field
.
Field
):
"""
Field representing an entire form.
...
...
@@ -219,7 +223,7 @@ class DeTable(field.Field):
_scripts
=
[]
# buttons = Params Buttons
for
button
in
buttons
:
if
isinstance
(
button
,
compat
.
string_types
):
if
isinstance
(
button
,
str
):
button
=
Button
(
button
)
obj_buttons
.
append
(
button
)
header_buttons
=
[]
...
...
opensipkd/detable/widget.py
View file @
dc7ed46
...
...
@@ -16,10 +16,10 @@ from iso8601.iso8601 import ISO8601_REGEX
from
translationstring
import
TranslationString
from
deform.widget
import
MappingWidget
from
deform.compat
import
text_
#
from deform.compat import text_
from
.i18n
import
_
_BLANK
=
text_
(
""
)
_BLANK
=
""
class
TableWidget
(
MappingWidget
):
...
...
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