pallets-eco / pallets-eco/flask-admin
Add Related or ForeignKey Model
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.1k
- Forks
- 1.6k
- Avg merge
- 6d 14h
- Merged PRs (30d)
- 1
Description
Currently, relationships are generally handled nicely, but adding an entry that references multiple related models is cumbersome.
I have a model that references 3 other models via ForeignKey. Let's just call it a Store model. The store model references an owner, a district and a category. To add a new store, you can select from all the available owners, districts and categories. But if you have to add a new store that has a new owner, district and category, you find yourself bouncing around creating 3 models and then the final Store entry.
It would be nice if, like Django, there would be something like an "add" button next to the ForeignKey fields, the entry form could appear in a popup window, or a modal if you want to utilize bootstrap. Upon saving the new entry, the field is completed for you with the new entry selected.
Any thoughts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing ForeignKey field rendering and add/edit form flow, focusing on how related entries are currently selected. Define the popup or modal behavior, including Bootstrap integration if used, and verify that saving a related entry selects it in the original form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100