Vendor derived from catalog model; model type shown separately

This commit is contained in:
2026-08-05 10:00:08 -04:00
parent c51e86e686
commit 73940ae992
9 changed files with 217 additions and 4 deletions

View File

@@ -138,6 +138,18 @@ class Computer(BaseModel):
result['modelname'] = self.model.modelnumber
if self.model.imageurl:
result['imageurl'] = self.model.imageurl
# The catalog model already knows its maker, so an asset that has a
# model but no vendor of its own is showing a blank the database can
# fill. Flagged rather than merged silently: the edit form still has
# an empty vendor box, and a page implying otherwise would be lying.
if not self.vendor and self.model.vendor:
result['vendorname'] = self.model.vendor.vendor
result['vendorfrommodel'] = True
# Exposed under its OWN name. modeltypes is the catalog-wide list
# covering every kind of asset, so it is not interchangeable with
# this asset's own type and must never be substituted for it.
if self.model.modeltype:
result['modeltypename'] = self.model.modeltype.modeltype
# Names of enabled remote-access protocols (for list badges)
result['accessprotocolnames'] = [