#21: feature/21-add-package-params #32

Merged
mhu merged 6 commits from feature/21-add-package-params into develop 2025-01-05 16:35:43 +01:00
Owner
No description provided.
mhu added 5 commits 2024-11-24 01:53:27 +01:00
mhu requested review from sst 2024-11-24 01:53:37 +01:00
sst was assigned by mhu 2024-11-24 01:53:40 +01:00
mhu added this to the v0.1.0 Release milestone 2024-11-24 01:53:42 +01:00
mhu added the
Kind/Feature
Kind/Enhancement
labels 2024-11-24 01:53:46 +01:00
sst added 1 commit 2025-01-05 16:11:15 +01:00
sst requested changes 2025-01-05 16:32:44 +01:00
Dismissed
@ -342,0 +349,4 @@
model = parts_models.PackageParameter
def save(self, package):
param_type = self.cleaned_data['parameter_type']
Collaborator

Concider moving the duplicated code into its own function e.g. param_type, text_value, value = _get_type_specific_values(self.cleaned_data)

...but feel free to leave it as is

Concider moving the duplicated code into its own function e.g. ``param_type, text_value, value = _get_type_specific_values(self.cleaned_data)`` ...but feel free to leave it as is
@ -0,0 +15,4 @@
all_comps = Component.objects.exclude(package__isnull=True)
for component in all_comps:
package_parameters = PackageParameter.objects.filter(package=component.package)
Collaborator

If performance matters it should be possible to forward select the components and add them to the first query using .prefetch_selected

...consider

If performance matters it should be possible to forward select the components and add them to the first query using .prefetch_selected ...consider
@ -250,2 +248,4 @@
text_value = models.TextField(null=False, blank=True)
def _get_object_of_param(self):
return None
Collaborator

The standard way in python would be to raise a NotImplementedException - so pylint etc. will know you have to override this method.

The standard way in python would be to raise a NotImplementedException - so pylint etc. will know you have to override this method.
@ -81,3 +121,3 @@
</div>
</div>
{% include 'parts/modals/new-component-parameter-modal.html' with component_name=object.name form=new_param_form %}
Collaborator

Either I am blind or you forgot to commit this file :)

Either I am blind or you forgot to commit this file :)
Collaborator

forget it - I was blind

forget it - I was blind
sst marked this conversation as resolved
sst approved these changes 2025-01-05 16:34:40 +01:00
Collaborator

Did not test it myself - code looks sane - some improvements could be done though :)

Did not test it myself - code looks sane - some improvements could be done though :)
mhu merged commit 550e996ae7 into develop 2025-01-05 16:35:43 +01:00
mhu deleted branch feature/21-add-package-params 2025-01-05 16:35:43 +01:00
Sign in to join this conversation.
No reviewers
sst
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mhu/shimatta-kenkyusho#32
No description provided.