Skip to content

Conversation

@brainexe
Copy link
Member

  • add filter for "attribute"
  • show all attribute changes with a toggle
  • fixed pagination (all filters were dropped on click)
  • add link to app/user for fast filtering
image

 - filter by attribute
 - show attribute changes with a toggle
 - fixed pagination
 - link on app/user for fast filtering
Copy link
Contributor

@kofrezo kofrezo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally did not include an attribute filter because the queries are rather expensive having a strong impact on the database cache slowing down everyday queries (Servershell + API). But we can give it a try and hope the feature does not get used all the time.

The rest looks okay to me. Nice improvements - thank you. You could check my comments and see if you could replace some of the custom methods with Django builtins.

newer = _validate_commit(changed, changed_objects)
if newer:
raise CommitNewerData('Newer data available', newer)
raise CommitNewerData(f'Newer data available for attribute {newer}', newer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is absolutely unrelated to polishing of the changes page no ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, a side change I applied during testing

return ', '.join(str(v) for v in value)
if isinstance(value, set):
return ', '.join(str(v) for v in sorted(value))
return str(value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is extra. It can be done using the builtin default template tag (here) and __str__ method.

prefix = f'<strong>{escape(attr_name)}:</strong>'
action = attr_change.get('action')
old_val = escape(_format_value(attr_change.get('old')))
new_val = escape(_format_value(attr_change.get('new')))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to escape a whole text you can also use the escape template filter (here).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but then it would also escape the wanted html tags like etc

@kofrezo
Copy link
Contributor

kofrezo commented Dec 19, 2025

The "diff" display does not work on my local computer when using this branch maybe you can double check that one.
Screenshot From 2025-12-19 09-52-14

- review changes
- Inspect page: add link to history of current object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants