Modernize datagrid columns, fix bugs, and add JSON serialization.
Review Request #14844 — Created Feb. 20, 2026 and updated
This is a major update to the existing datagrid columns, largely
preparing them for the new Dashboard API resource, and fixing up a
number of issues in their implementation.All columns now provide a stable JSON representation that can be used in
the API, returning structured data, API-compatible objects (which will
be turned into payloads or links), or raw values.In some cases, this is done by overriding the new
to_json(), but in
most we just now calculate the state for both the JSON and HTML
representations in the column-controlledget_raw_object_value(). This
keeps the data calculation in one place, and simplifies both output
functions (often using default logic).HTML rendering has been fixed in all places to correctly use
format_html()orescape()for results. This will future-proof these
columns for when the datagrid code starts escaping non-SafeStrings.Most of the
__init__()methods are now gone, instead using the new
class-defined attributes. This is much easier to maintain and
specialize.Types have been fixed and annotated all throughout, catching issues in
some of the logic.Many bugs (such as extra spaces at the end of values, wrong data types
being returned where strings are expected) that weren't previously
caught have been fixed, with tests updated to strictly check return
types.
Unit tests pass.
Tested all columns in the dashboard in both the browser and with
a test script using the in-progress dashboard API.
| Summary | ID |
|---|---|
| 72d15e72a7b1924eebb0dc388815883dbbb0e2fd |
| Description | From | Last Updated |
|---|---|---|
|
This should be bool |
|
|
|
This should be list of dict and explain what the dict return value contains. |
|
|
|
We should use a walrus operator to pull out diffset_history and last_diff_updated instead of accessing them each time. |
|
|
|
This should be Group |
|
|
|
This should just say "The review request being ..." |
|
|
|
These should probably have a default of None |
|
|
|
This is returning an unclosed <div> |
|
|
|
This should be Group |
|
|
|
This should probably pass a default of 0 |
|
|
|
This should probably have a default of '' |
|
|
|
This should probably have a default of VISIBLE |
|
|
|
This description doesn't apply here. |
|
|
|
This wasn't sortable before, but is now. I don't think that was intentional given the contents of this column. |
|
|
|
This looks like it's supposed to be the description for the ToMeColumn, we should move it there. |
|
|
|
This was copy/pasted from BugsColumn without being updated. |
|
|
|
Typos: josn -> json |
|
|
|
Typos: josn -> json |
|
|
|
'django.utils.html.conditional_escape' imported but unused Column: 1 Error code: F401 |
|
|
|
We're no longer setting link_func. It seems like Column.__init__ will set it to the datagrid's link_to_object, not the column's link_to_object. |
|
|
|
This should be called "group" instead of "user" |
|
|
|
We're using getattr without defaults, which could raise AttributeError. Seems like maybe we want to default to False? |
|
|
|
Same here re: link_func |
|
|
|
Another getattr without a default. |
|
|
|
Another getattr without a default. |
|
|
|
Another getattr without a default. |
|
|
|
This was copy/pasted from something else. |
|
- Change Summary:
-
- Fixed several doc issues and typos.
- Fixed bad rendering of the Diff Last Updated column value and improved tests there.
- Added specific types for some of the raw values.
- Fixed unclosed HTML tags.
- Reverted being able to sort the Diff Size column. This was accidental.
- Made use of a walrus operator to pull data out for the Diff Last Updated value.
- Commits:
-
Summary ID 826620197224da1889c20928695d233654abe1f7 0bc60fb26398a6b7df0d21751a62516979d1a68a - Diff:
-
Revision 2 (+5330 -1122)
- Change Summary:
-
- Restored the broken
link_funcvalues. - Fixed some bad docs.
- Fixed an incorrect variable name.
- Restored the broken
- Commits:
-
Summary ID 0bc60fb26398a6b7df0d21751a62516979d1a68a 72d15e72a7b1924eebb0dc388815883dbbb0e2fd - Diff:
-
Revision 3 (+5332 -1124)