View Container
Learn how to design a modal view container to list the book records.
About the application
Our last view allows us to add and edit the books in our database. The application requires logic in this view and will only allow modifications to the data if the user is logged in. If not logged in, the data will be viewable but will be displayed as read-only.
This is what the application looks like:
Note: To log in, use the username
admin
and password123
.
Copyright (c) 2020 John Sheehan Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
The main view container
The main view container will hold, among other things, the title bar, close button, and a separate form component that displays all of the fields of the book record.
About the bookEditView
module
First, we can see a new folder bookEdit/
inside bookapp/client/src/views/
. Inside that, we have an empty __init__.py
file to that folder to be treated as a Python package. Next, we will look at the bookEditView.py
module in the same ...