Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Taufik Yulianto
/
esipkd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 911ae836
authored
Mar 23, 2015
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add report Admin
1 parent
7b1e0698
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
esipkd/views/base_view.py
esipkd/views/base_view.py
0 → 100755
View file @
911ae83
from
pyramid.response
import
Response
from
pyramid.view
import
view_config
from
pyramid.httpexceptions
import
HTTPFound
from
pyramid.renderers
import
get_renderer
from
pyramid.url
import
resource_url
from
pyramid.security
import
remember
from
pyramid.security
import
forget
from
pyramid.security
import
has_permission
from
datetime
import
datetime
from
sqlalchemy.exc
import
DBAPIError
import
colander
from
..models
import
(
DBSession
,
UserResourcePermission
,
Resource
,
User
,
)
from
datetime
import
(
datetime
,
date
)
from
pyjasper.client
import
JasperGenerator
class
BaseViews
(
object
):
def
__init__
(
self
,
context
,
request
):
self
.
context
=
context
self
.
request
=
request
self
.
session
=
request
.
session
self
.
datas
=
{}
cday
=
datetime
.
today
()
def
_DTstrftime
(
self
,
chain
):
ret
=
chain
and
datetime
.
strftime
(
chain
,
'
%
d-
%
m-
%
Y'
)
if
ret
:
return
ret
else
:
return
chain
def
_number_format
(
self
,
chain
):
import
locale
locale
.
setlocale
(
locale
.
LC_ALL
,
'id_ID.utf8'
)
ret
=
locale
.
format
(
"
%
d"
,
chain
,
grouping
=
True
)
if
ret
:
return
ret
else
:
return
chain
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