Compare commits
No commits in common. "a26f16a67e1d246ee12a7096be730cb8ba97c5ea" and "8fc9851e2122cb959ff9e4673a506cb3e282e56a" have entirely different histories.
a26f16a67e
...
8fc9851e21
2 changed files with 4 additions and 16 deletions
|
|
@ -667,17 +667,10 @@ class AssetRefsWidget(Widget):
|
||||||
|
|
||||||
readonly = kw.get("readonly", self.readonly)
|
readonly = kw.get("readonly", self.readonly)
|
||||||
if readonly:
|
if readonly:
|
||||||
|
|
||||||
assets = []
|
assets = []
|
||||||
for uuid in cstruct or []:
|
for uuid in cstruct or []:
|
||||||
if asset := session.get(model.Asset, uuid):
|
asset = session.get(model.Asset, uuid)
|
||||||
assets.append(asset)
|
assets.append(
|
||||||
|
|
||||||
assets.sort(key=lambda asset: asset.asset_name)
|
|
||||||
|
|
||||||
html = []
|
|
||||||
for asset in assets:
|
|
||||||
html.append(
|
|
||||||
HTML.tag(
|
HTML.tag(
|
||||||
"li",
|
"li",
|
||||||
c=tags.link_to(
|
c=tags.link_to(
|
||||||
|
|
@ -688,8 +681,7 @@ class AssetRefsWidget(Widget):
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
return HTML.tag("ul", c=assets)
|
||||||
return HTML.tag("ul", c=html)
|
|
||||||
|
|
||||||
values = kw.get("values", self.values)
|
values = kw.get("values", self.values)
|
||||||
if not isinstance(values, sequence_types):
|
if not isinstance(values, sequence_types):
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,6 @@ class AssetMasterView(WuttaFarmMasterView):
|
||||||
|
|
||||||
row_labels = {
|
row_labels = {
|
||||||
"message": "Log Name",
|
"message": "Log Name",
|
||||||
"locations": "Location",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
row_grid_columns = [
|
row_grid_columns = [
|
||||||
|
|
@ -113,7 +112,7 @@ class AssetMasterView(WuttaFarmMasterView):
|
||||||
"message",
|
"message",
|
||||||
"log_type",
|
"log_type",
|
||||||
"assets",
|
"assets",
|
||||||
"locations",
|
"location",
|
||||||
"quantity",
|
"quantity",
|
||||||
"is_group_assignment",
|
"is_group_assignment",
|
||||||
]
|
]
|
||||||
|
|
@ -447,9 +446,6 @@ class AssetMasterView(WuttaFarmMasterView):
|
||||||
# assets
|
# assets
|
||||||
g.set_renderer("assets", self.render_assets_for_grid)
|
g.set_renderer("assets", self.render_assets_for_grid)
|
||||||
|
|
||||||
# locations
|
|
||||||
g.set_renderer("locations", self.render_assets_for_grid)
|
|
||||||
|
|
||||||
def render_assets_for_grid(self, log, field, value):
|
def render_assets_for_grid(self, log, field, value):
|
||||||
assets = getattr(log, field)
|
assets = getattr(log, field)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue