Commit ff250a88 authored by impfundev's avatar impfundev

feat: published_year in book master

parent 8d6b339d
...@@ -5,7 +5,14 @@ from books.models import Book ...@@ -5,7 +5,14 @@ from books.models import Book
class BookForm(forms.ModelForm): class BookForm(forms.ModelForm):
class Meta: class Meta:
model = Book model = Book
fields = ["cover_image", "title", "stock", "category", "description"] fields = [
"cover_image",
"title",
"stock",
"category",
"description",
"published_year",
]
widgets = { widgets = {
"cover_image": forms.FileInput( "cover_image": forms.FileInput(
...@@ -38,4 +45,10 @@ class BookForm(forms.ModelForm): ...@@ -38,4 +45,10 @@ class BookForm(forms.ModelForm):
"class": "form-control", "class": "form-control",
} }
), ),
"published_year": forms.TextInput(
attrs={
"type": "number",
"class": "form-control",
}
),
} }
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<th scope="col">Category</th> <th scope="col">Category</th>
<th scope="col">Stock</th> <th scope="col">Stock</th>
<th scope="col">Description</th> <th scope="col">Description</th>
<th scope="col">Year</th>
<th scope="col">Created At</th> <th scope="col">Created At</th>
<th scope="col">Updated At</th> <th scope="col">Updated At</th>
<th scope="col"></th> <th scope="col"></th>
...@@ -17,6 +18,7 @@ ...@@ -17,6 +18,7 @@
<td>{{ book.category.name }}</td> <td>{{ book.category.name }}</td>
<td>{{ book.stock }}</td> <td>{{ book.stock }}</td>
<td>{{ book.description }}</td> <td>{{ book.description }}</td>
<td>{{ book.published_year }}</td>
<td>{{ book.created_at }}</td> <td>{{ book.created_at }}</td>
<td>{{ book.updated_at }}</td> <td>{{ book.updated_at }}</td>
<td> <td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment