#21: feature/21-add-package-params #32
No reviewers
Labels
No Label
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: mhu/shimatta-kenkyusho#32
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/21-add-package-params"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -342,0 +349,4 @@
model = parts_models.PackageParameter
def save(self, package):
param_type = self.cleaned_data['parameter_type']
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)
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
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 %}
Either I am blind or you forgot to commit this file :)
forget it - I was blind
Did not test it myself - code looks sane - some improvements could be done though :)