Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
library-app-django
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
Ilham Maulana
library-app-django
Commits
ff250a88
Commit
ff250a88
authored
Jul 10, 2024
by
impfundev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: published_year in book master
parent
8d6b339d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
forms.py
books/forms.py
+14
-1
book_table_data.html
books/templates/book_table_data.html
+2
-0
No files found.
books/forms.py
View file @
ff250a88
...
...
@@ -5,7 +5,14 @@ from books.models import Book
class
BookForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Book
fields
=
[
"cover_image"
,
"title"
,
"stock"
,
"category"
,
"description"
]
fields
=
[
"cover_image"
,
"title"
,
"stock"
,
"category"
,
"description"
,
"published_year"
,
]
widgets
=
{
"cover_image"
:
forms
.
FileInput
(
...
...
@@ -38,4 +45,10 @@ class BookForm(forms.ModelForm):
"class"
:
"form-control"
,
}
),
"published_year"
:
forms
.
TextInput
(
attrs
=
{
"type"
:
"number"
,
"class"
:
"form-control"
,
}
),
}
books/templates/book_table_data.html
View file @
ff250a88
...
...
@@ -5,6 +5,7 @@
<th
scope=
"col"
>
Category
</th>
<th
scope=
"col"
>
Stock
</th>
<th
scope=
"col"
>
Description
</th>
<th
scope=
"col"
>
Year
</th>
<th
scope=
"col"
>
Created At
</th>
<th
scope=
"col"
>
Updated At
</th>
<th
scope=
"col"
></th>
...
...
@@ -17,6 +18,7 @@
<td>
{{ book.category.name }}
</td>
<td>
{{ book.stock }}
</td>
<td>
{{ book.description }}
</td>
<td>
{{ book.published_year }}
</td>
<td>
{{ book.created_at }}
</td>
<td>
{{ book.updated_at }}
</td>
<td>
...
...
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