hackforla / hackforla/knowledgebase

M-M: Organization to User - create table, api, and tests

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
category: M-M complexity: medium dependency draft feature: table: organization milestone: missing role: back end dev size: 2pt
Dominant language
Python
Stars
2
Forks
5
PR merge metrics
No merged PRs in 30d

Description

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.