vsoch / freegenes

FreeGenes BioNode with Django
https://vsoch.github.io/freegenes/
Mozilla Public License 2.0
2 stars 4 forks source link

Method to remove all Parts from a FactoryOrder #93

Closed Koeng101 closed 5 years ago

Koeng101 commented 5 years ago

I'd like to be able to reset Parts which are directly associated with FactoryOrders (e.coli red20 has too many parts and bacillus subtilis essentials don't have enough, so I assume I accidentally swapped em the latter's parts to the first)

vsoch commented 5 years ago

Just to clarify - reset == clear the associated parts (but don't delete them)?

Koeng101 commented 5 years ago

Yes

vsoch commented 5 years ago

This might take me a while to figure out, logically the admin view should expose a minus sign to remove many to many (but it doesn't) and Googling I haven't found a way yet.

Koeng101 commented 5 years ago

Ok - I'll ignore that one for now

vsoch commented 5 years ago

Okay I found a way to test - adding an action to the factory order list page:

image

Koeng101 commented 5 years ago

Awesome!!!

vsoch commented 5 years ago

Okay it's live on the server!

https://github.com/vsoch/freegenes/commit/8a59d3c81da7ac382ffad229afdce055da694ed6

And actually you can already do this - I realize in retrospect that when you look at the details page for a FactoryOrder, it's not that a red minus sign is missing, but the select shows ALL the parts/plates in the database (and then you can highlight the ones wanted). For example, here we can see a subset of selected and not selected:

image

(it's actually blue when the page is active) so the staff could de-select all those selected to do the same reset action. However, it's still good that we added the button because that seems easier to do, at least to remove all globally.

Koeng101 commented 5 years ago

Awesome! Just used it. Works!