File tree 2 files changed +22
-2
lines changed
templates/component_catalog/tabs
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 6
6
< th > {% trans 'Package URL' %}</ th >
7
7
< th > {% trans 'Download URL' %}</ th >
8
8
< th > {% trans 'Filename' %}</ th >
9
+ < th > {% trans 'Concluded license' %}</ th >
9
10
</ tr >
10
11
</ thead >
11
12
< tbody >
21
22
< a href ="{{ package.get_absolute_url }} " target ="_blank "> {{ package.package_url }}</ a >
22
23
{% endif %}
23
24
</ td >
24
- < td > {{ package.download_url|default_if_none:"" }}</ td >
25
25
< td > {{ package.filename|default_if_none:"" }}</ td >
26
+ < td > {{ package.download_url|default_if_none:"" }}</ td >
27
+ < td > {{ package.license_expression|default_if_none:"" }}</ td >
26
28
</ tr >
27
29
{% endfor %}
28
30
</ tbody >
Original file line number Diff line number Diff line change 67
67
from component_catalog .license_expression_dje import get_unique_license_keys
68
68
from component_catalog .models import Component
69
69
from component_catalog .models import Package
70
+ from component_catalog .models import PACKAGE_URL_FIELDS
70
71
from component_catalog .models import PackageAlreadyExistsWarning
71
72
from component_catalog .models import Subcomponent
72
73
from dejacode_toolkit .download import DataCollectionException
@@ -1300,7 +1301,24 @@ def tab_others(self):
1300
1301
1301
1302
def tab_package_set (self ):
1302
1303
plain_url = self .object .plain_package_url
1303
- related_packages = self .get_queryset ().for_package_url (plain_url )
1304
+ related_packages = (
1305
+ self .model .objects .scope (self .object .dataspace )
1306
+ .for_package_url (plain_url )
1307
+ .only (
1308
+ "uuid" ,
1309
+ * PACKAGE_URL_FIELDS ,
1310
+ "filename" ,
1311
+ "download_url" ,
1312
+ "license_expression" ,
1313
+ "dataspace__name" ,
1314
+ )
1315
+ .order_by (
1316
+ * PACKAGE_URL_FIELDS ,
1317
+ "filename" ,
1318
+ "download_url" ,
1319
+ )
1320
+ .distinct ()
1321
+ )
1304
1322
1305
1323
template = "component_catalog/tabs/tab_package_set.html"
1306
1324
if len (related_packages ) > 1 :
You can’t perform that action at this time.
0 commit comments