hackforla / hackforla/knowledgebase
M-M: Organization to User - create table, api, and tests
- Vorherrschende Sprache
- Python
- Sterne
- 2
- Forks
- 5
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
### Dependencies
- #47
### Overview
As a user I want to be able to see what practice areas are associated with an asset group
### Action Items
- [ ] Remove ManyToMany field for Tool in the Asset Group model
- [ ] Add model AssetGroupsToolsMM with two foreign keys. See PracticeArea as an example.
- [ ] Add code something like this to model_inline.py, replacing AssetGroup with Organizations and Tool with User:
ic```
class AssetGroupsToolInline(admin.TabularInline):
model = AssetGroupsToolsMM
extra = 5
class AssetGroupsToolsAdmin(admin.ModelAdmin):
inlines = [AssetGroupToolsInline]
list_display = ("Tools.name")
search_fields = ["Tools.name"]
```
- Add to admin.py:
```
admin.register(Assets, AssetGroupsToolAdmin)
```
### Manual Verification
- From UI, you should be able to add multiple users to an organization and only the added tools will show on the screen
- From DBVisualizer or other Postgres ide you should be able to see creation and update info in AssetsToolsMM table.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.