Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
coba
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a5afa5e3
authored
Mar 12, 2025
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
latihan view-1
1 parent
be2c6e38
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
3 deletions
opensipkd/coba/__init__.py
opensipkd/coba/views/contoh.py
opensipkd/coba/views/view_upload.py
opensipkd/coba/__init__.py
View file @
a5afa5e
...
...
@@ -13,6 +13,60 @@ ROUTES = [
"template"
:
"home.pt"
,
},
{
"kode"
:
"coba-contoh-menu"
,
"nama"
:
"Contoh Menu"
,
"is_menu"
:
1
,
"children"
:
[
{
"kode"
:
"coba-contoh"
,
"nama"
:
"Contoh "
,
"is_menu"
:
1
,
"path"
:
"/coba/contoh"
,
"class_view"
:
"contoh"
,
"def_func"
:
"list"
,
"template"
:
"list.pt"
,
"permission"
:
"view"
,
"children"
:
[
{
"kode"
:
"coba-contoh-add"
,
"nama"
:
"Tambah"
,
"path"
:
"/coba/contoh/add"
,
"class_view"
:
"contoh"
,
"def_func"
:
"add"
,
"template"
:
"form.pt"
,
"permission"
:
"view"
},
{
"kode"
:
"coba-contoh-edit"
,
"nama"
:
"Edit"
,
"path"
:
"/coba/contoh/{id}/edit"
,
"class_view"
:
"contoh"
,
"def_func"
:
"edit"
,
"template"
:
"form.pt"
,
"permission"
:
"view"
},
{
"kode"
:
"coba-contoh-view"
,
"nama"
:
"Lihat"
,
"path"
:
"/coba/contoh/{id}/view"
,
"def_func"
:
"view"
,
"class_view"
:
"contoh"
,
"template"
:
"form.pt"
,
"permission"
:
"view"
},
{
"kode"
:
"coba-contoh-delete"
,
"nama"
:
"Hapus"
,
"path"
:
"/coba/contoh/{id}/delete"
,
"class_view"
:
"contoh"
,
"def_func"
:
"delete"
,
"template"
:
"form.pt"
,
"permission"
:
"view"
},
{
"kode"
:
"coba-contoh-act"
,
"path"
:
"/coba/contoh/{act}/act"
,
"nama"
:
"Action"
,
"class_view"
:
"contoh"
,
"def_func"
:
"act"
,
"template"
:
"json"
,
"permission"
:
"view"
},
]}
]},
{
"kode"
:
"coba-menus"
,
"nama"
:
"Menus"
,
"is_menu"
:
1
,
...
...
@@ -33,7 +87,6 @@ ROUTES = [
"template"
:
"form.pt"
,
"permission"
:
"view"
,
"children"
:
[
{
"kode"
:
"coba-form-edit"
,
"nama"
:
"Edit"
,
"path"
:
"/coba/form/{id}/edit"
,
...
...
opensipkd/coba/views/contoh.py
0 → 100644
View file @
a5afa5e
import
colander
from
deform
import
widget
from
opensipkd.base.views
import
BaseView
from
opensipkd.coba.models
import
Coba
class
ListSchema
(
colander
.
Schema
):
id
=
colander
.
SchemaNode
(
colander
.
Integer
(),
widget
=
widget
.
HiddenWidget
(),
missing
=
colander
.
drop
,
)
kode
=
colander
.
SchemaNode
(
colander
.
String
(),
widget
=
widget
.
TextInputWidget
(
mask
=
"9999-9999"
),
)
nama
=
colander
.
SchemaNode
(
colander
.
String
(),
widget
=
widget
.
TextInputWidget
(),
validator
=
colander
.
Length
(
min
=
5
,
max
=
20
)
)
class
AddSchema
(
ListSchema
):
def
after_bind
(
self
,
node
,
kw
):
del
node
[
"id"
]
class
Views
(
BaseView
):
def
__init__
(
self
,
request
):
super
()
.
__init__
(
request
)
self
.
list_schema
=
ListSchema
self
.
add_schema
=
AddSchema
self
.
edit_schema
=
ListSchema
self
.
table
=
Coba
self
.
list_route
=
"coba-contoh"
\ No newline at end of file
opensipkd/coba/views/view_upload.py
View file @
a5afa5e
import
os
import
colander
from
deform
import
widget
,
FileData
from
pyramid.view
import
view_config
from
opensipkd.coba
import
MODULE_CLASS
from
opensipkd.tools
import
mem_tmp_store
,
Upload
from
opensipkd.base
import
get_urls
from
opensipkd.coba.models
import
Coba
from
.
import
BaseView
# from opensipkd.coba import COBA_UPLOAD
# from opensipkd.base.views import widget_os
# from opensipkd.tools.report import csv_response
...
...
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