Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
irul
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a7d72c4a
authored
Jun 04, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan base_view
1 parent
d975f9ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
README.rst
opensipkd/base/views/base_views.py
README.rst
View file @
a7d72c4
...
...
@@ -18,7 +18,7 @@ Buat Python Virtual Environment, biasanya pada home directory::
Install Production
------------------
$ ~/env/bin/pip install git+https://git
.opensipkd.com/aa.gusti/opensipkd-base
.git
$ ~/env/bin/pip install git+https://git
hub.com/aagusti/tandur
.git
$ cp ~/env/etc/live_opensipkd.tpl ~/env/etc/live_opensipkd.ini
Install Development::
...
...
@@ -44,6 +44,10 @@ pada baris berikut ini::
sqlalchemy.url = postgresql://user:password@localhost:5432/db
script_location = opensipkd.base:alembic
[alembic_tandur]
sqlalchemy.url = postgresql://user:password@localhost:5432/db
script_location = tandur:alembic
Handling Log File:
==================
...
...
opensipkd/base/views/base_views.py
View file @
a7d72c4
...
...
@@ -174,10 +174,10 @@ class BaseView(object):
table
=
self
.
get_item_table
()
return
dict
(
form
=
form
.
render
(),
table
=
table
and
table
.
render
()
or
None
,
scripts
=
self
.
form_scripts
)
def
before_save
(
self
,
row
):
pass
def
before_save
(
self
,
row
,
values
):
return
row
def
after_save
(
self
,
row
):
def
after_save
(
self
,
row
,
values
):
pass
def
save
(
self
,
values
,
user
,
row
=
None
):
...
...
@@ -191,10 +191,10 @@ class BaseView(object):
row
.
from_dict
(
values
)
row
.
status
=
'status'
in
values
and
values
[
'status'
]
and
1
or
0
self
.
before_save
(
row
)
row
=
self
.
before_save
(
row
,
values
)
DBSession
.
add
(
row
)
DBSession
.
flush
()
self
.
after_save
(
row
)
self
.
after_save
(
row
,
values
)
return
row
def
save_request
(
self
,
values
,
row
=
None
):
...
...
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