hackforla / hackforla/knowledgebase

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

Aperta
#49 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
category: M-M complexity: medium dependency draft feature: table: organization milestone: missing role: back end dev size: 2pt
Lingua principale
Python
Stelle
2
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.