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 c7cf6363
authored
Jan 19, 2026
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: Update import statements and add table name for Departemen model
1 parent
6dde02de
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
5 deletions
opensipkd/base/models/__init__.py
opensipkd/base/models/departmen.py
opensipkd/base/views/base_views.py
opensipkd/base/views/templates/base5.pt
opensipkd/base/models/__init__.py
View file @
c7cf636
...
...
@@ -7,4 +7,4 @@ from .wilayah import *
from
.partner
import
*
from
.targets
import
*
from
.user_area
import
*
from
.departmen
import
*
from
.departmen
import
_Departemen
,
Departemen
opensipkd/base/models/departmen.py
View file @
c7cf636
...
...
@@ -5,7 +5,6 @@ from ..models import (NamaModel, TABLE_ARGS)
class
_Departemen
(
NamaModel
):
__tablename__
=
'departemen'
__table_args__
=
(
TABLE_ARGS
,)
id
=
Column
(
Integer
,
primary_key
=
True
)
parent_id
=
Column
(
Integer
,
ForeignKey
(
'public.departemen.id'
))
...
...
@@ -13,6 +12,7 @@ class _Departemen(NamaModel):
alamat
=
Column
(
String
(
255
))
singkat
=
Column
(
String
(
32
))
level_id
=
Column
(
SmallInteger
)
__tablename__
=
'departemen'
@declared_attr
def
children
(
self
):
return
relationship
(
...
...
@@ -47,4 +47,4 @@ class _Departemen(NamaModel):
return
DBSession
.
query
(
cls
.
id
,
cls
.
nama
)
.
order_by
(
cls
.
nama
)
.
all
()
class
Departemen
(
_Departemen
,
Base
):
pass
db_session
=
DBSession
opensipkd/base/views/base_views.py
View file @
c7cf636
...
...
@@ -1244,6 +1244,10 @@ class BaseView(object):
# self.form_error(form, error)
def
save_file
(
self
,
values
,
field
,
path
=
None
,
filename
=
None
):
"""digunakan untuk menyimpan file upload dari form
Args:
"""
if
field
in
values
and
values
[
field
]:
value
=
values
[
field
]
file_name
=
value
[
"filename"
]
...
...
opensipkd/base/views/templates/base5.pt
View file @
c7cf636
...
...
@@ -101,12 +101,14 @@
<!-- end fullscreen button -->
<!-- User info -->
<ul
tal:condition=
"not request.user"
class=
"header-dropdown-list hidden-xs"
>
<ul
tal:condition=
"not request.user"
class=
"header-dropdown-list"
>
<li>
<a
href=
"${home}/login"
class=
"dropdown-toggle"
><i
class=
"fa fa-lg fa-fw fa-user"
></i>
Login
</a>
</li>
</ul>
<ul
tal:condition=
"request.user"
class=
"header-dropdown-list hidden-xs"
>
<ul
tal:condition=
"request.user"
class=
"header-dropdown-list"
>
<li>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
><i
class=
"fa fa-lg fa-fw fa-user"
></i>
<span
style=
"text-transform:capitalize"
>
${request.user and request.user.nice_username() or ""}
...
...
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