Copy references and tolerances between units
At the moment the following steps need to be taken to use a new TestList:
- Create Tests
- Add Tests to TestList
- Assign TestList to Unit(s)
- Assign references and tolerances to each test
I think there should be a third step available in the admin 'Copy References & Tolerances'.
At the moment the references and tolerances need to be set for each Unit specifically. We have 8 accelerators on which we use TestLists which are exactly the same, with the same References and Tolerances. If a TestList contains 20 tests this would mean setting 160 References and Tolerances, a lot of work.
Therefore I would like to introduce a admin page: 'Copy References & Tolerances'. Then the steps would be:
- Assign TestList to Unit(s)
- Assign references and tolerances to each test for one unit
- Copy References and Tolerances to other Units with same TestList
What is needed:
- Url in the admin page to 'Copy References & Tolerances'
- view for copying the references and tolerances
- some jQuery to make it a little bit interactive
- Tests
Suggestion:
- Create a url in the admin page with: django-admin views
- There a form would display the following: 1. Select Unit to copy from (get TestLists, jQuery), 2. Select TestList to Copy (get Units with same TestList, jQuery), 3. Select Unit to copy too, 4. 'Copy References & Tolerances'
Questions:
- Is it a good idea to use django-admin views? pros: url in admin, easy setup, cons: url on the bottom of the admin (see image).
- Can is easily use the django-admin css for my template to keep the same look? Or should I use Bootstrap?
- Where would be the best place to put the code for saving the References and Tolerances? Models.py?
- Where would be the best place to create the view(s)? I thought maybe: qa/views/custom_admin.py
Randle I hope you like this idea. Would help us out alot in terms of repetition. Also: I cannot assign this issue to me?
Comments (6)
-
-
-
assigned issue to
-
assigned issue to
-
Also...I explicitly added your username to the repo so you can be assigned to issues now!
-
- changed status to open
-
reporter Thanks! I was already wondering why I couldn't assign myself to issues.
-
- changed status to resolved
Resolved in pull request #23. Thanks @wenzevanklink !
- Log in to comment
Yes I agree, this is currently a huge pain! We also have many accelerators where it would be very nice to copy over the references :)
Your plan looks quite good.
I'm not too familiar with this package but it looks like it should work. I like keeping this functionality in the admin (rather than the front-end-site) for consistency.
Yes I would say use the admin css. I don't think it's too pretty but I think we should be consistent in the look of the admin site. Maybe in the future we can look at Django Admin 2 or Grappelli to make the admin look nicer.
Hmmm....I think the easiest might be to put the code on the
UnitTestCollection
model. So you could create a method onUnitTestCollection
like so:or something along those lines.
That's where I would put it.
custom_admin.py
is fine but I might just call itadmin.py
(e.g.qa/views/admin.py
). I don't have a strong preference either way though :)