-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename nested-forms to Master-Detail Forms
- Loading branch information
Showing
12 changed files
with
37 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Master-Detail Forms (Nested Forms) | ||
|
||
This example shows how to handle inserting data into multiple tables | ||
with a one-to-many relationship. | ||
|
||
![db schema](./screenshots/db-schema.png) | ||
|
||
A single master page features two forms based on two related tables or views. | ||
Users insert data in the master form first to update information from the parent table. | ||
Then, they can insert data in the detail forms to update information from the child tables. | ||
|
||
This example application contains a main form to create users, | ||
and a second form to create their addresses. | ||
|
||
Once an user has been added, multiple addresses can be added to it. | ||
|
||
See https://github.com/lovasoa/SQLpage/discussions/16 for more details. | ||
|
||
The main idea is to create two separate forms. | ||
In this example, we put both forms on the same page, in [`edit-user.sql`](./edit-user.sql). | ||
The first one is an edition form for the already-existing user record, | ||
and the second is a form to add an address to the user. | ||
|
||
When you initially load the user creation form, | ||
we do not display the address form. | ||
Only when the user has been created, | ||
you are redirected to the user edition form that contains the address form. | ||
|
||
|
||
## Screenshots | ||
|
||
![homepage](./screenshots/home-screenshot.png) | ||
![user addition](./screenshots//user-add-screenshot.png) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM lovasoa/sqlpage | ||
|
||
COPY *.sql sqlpage ./ |