Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
1366b36c
Commit
1366b36c
authored
May 25, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added integer-field to supported custom colums
parent
3acf80c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
book_edit.html
cps/templates/book_edit.html
+1
-1
web.py
cps/web.py
+1
-1
No files found.
cps/templates/book_edit.html
View file @
1366b36c
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
{% endif %}
{% endif %}
{% if c.datatype == 'int' %}
{% if c.datatype == 'int' %}
<input
type=
"number"
step=
"1"
class=
"form-control"
name=
"{{ 'custom_column_' ~ c.id }}"
id=
"{{ 'custom_column_' ~ c.id }}"
value=
"{
{ book['custom_column_' ~ c.id][0].value }
}"
>
<input
type=
"number"
step=
"1"
class=
"form-control"
name=
"{{ 'custom_column_' ~ c.id }}"
id=
"{{ 'custom_column_' ~ c.id }}"
value=
"{
% if book['custom_column_' ~ c.id]|length > 0 %}{{ book['custom_column_' ~ c.id][0].value }}{% endif %
}"
>
{% endif %}
{% endif %}
{% if c.datatype in ['text', 'series'] and not c.is_multiple %}
{% if c.datatype in ['text', 'series'] and not c.is_multiple %}
...
...
cps/web.py
View file @
1366b36c
...
@@ -1313,7 +1313,7 @@ def delete_book(book_id):
...
@@ -1313,7 +1313,7 @@ def delete_book(book_id):
cc_string
=
"custom_column_"
+
str
(
c
.
id
)
cc_string
=
"custom_column_"
+
str
(
c
.
id
)
if
not
c
.
is_multiple
:
if
not
c
.
is_multiple
:
if
len
(
getattr
(
book
,
cc_string
))
>
0
:
if
len
(
getattr
(
book
,
cc_string
))
>
0
:
if
c
.
datatype
==
'bool'
:
if
c
.
datatype
==
'bool'
or
c
.
datatype
==
'integer'
:
del_cc
=
getattr
(
book
,
cc_string
)[
0
]
del_cc
=
getattr
(
book
,
cc_string
)[
0
]
getattr
(
book
,
cc_string
)
.
remove
(
del_cc
)
getattr
(
book
,
cc_string
)
.
remove
(
del_cc
)
db
.
session
.
delete
(
del_cc
)
db
.
session
.
delete
(
del_cc
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment