Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
janang_reading
Project
Project
Details
Activity
Releases
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
Jan Ericsson Ong Ang
janang_reading
Commits
a2727c82
Commit
a2727c82
authored
Apr 25, 2023
by
Jan Ericsson Ong Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated forms.py
parent
a0c246cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
forms.py
janang_reading/bookshelf/forms.py
+9
-15
No files found.
janang_reading/bookshelf/forms.py
View file @
a2727c82
from
django
import
forms
from
django
import
forms
from
django.db
import
models
from
.models
import
Books
,
Author
from
models
import
Author
class
AuthorForm
(
forms
.
Form
):
class
AuthorForm
(
forms
.
ModelForm
):
first_name
=
forms
.
CharField
(
label
=
'first_name'
,
max_length
=
50
)
class
Meta
:
last_name
=
forms
.
CharField
(
label
=
'last_name'
,
max_length
=
50
)
model
=
Author
age
=
forms
.
IntegerField
(
label
=
'age'
)
fields
=
"__all__"
nationality
=
forms
.
CharField
(
label
=
'nationality'
,
max_length
=
50
)
bio
=
forms
.
TextField
(
label
=
'bio'
,
max_length
=
700
)
class
BookForm
(
forms
.
Form
):
class
BookForm
(
forms
.
ModelForm
):
title
=
forms
.
CharField
(
label
=
'title'
,
max_length
=
50
)
class
Meta
:
author
=
forms
.
ForeignKey
(
Author
,
on_delete
=
models
.
CASCADE
)
model
=
Books
publisher
=
forms
.
CharField
(
label
=
'publisher'
,
max_length
=
50
)
fields
=
"__all__"
year_published
=
forms
.
IntegerField
(
label
=
'year_published'
,
max_length
=
50
)
\ No newline at end of file
ISBN
=
forms
.
CharField
(
label
=
'ISBN'
,
max_length
=
50
)
blurb
=
forms
.
CharField
(
label
=
'blurb'
,
max_length
=
50
)
\ No newline at end of file
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