kopia lustrzana https://github.com/wagtail/wagtail
Add string representation to image Format() (#6608)
when checking on the currently registered Formats, e.g. with `get_image_formats()` the output is now easier to read.pull/6624/head
rodzic
ac88310402
commit
6a7a5756d9
|
@ -7,6 +7,7 @@ Changelog
|
|||
* StreamField values can now be modified in-place (Matt Westcott)
|
||||
* Added support for Python 3.9
|
||||
* Switch pagination icons to use SVG instead of icon fonts (Scott Cranfill)
|
||||
* Added string representation to image Format class (Andreas Nüßlein)
|
||||
* Fix: Stop menu icon overlapping the breadcrumb on small viewport widths in page editor (Karran Besen)
|
||||
* Fix: Make sure document chooser pagination preserves the selected collection when moving between pages (Alex Sa)
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ Other features
|
|||
|
||||
* Added support for Python 3.9
|
||||
* Switch pagination icons to use SVG instead of icon fonts (Scott Cranfill)
|
||||
* Added string representation to image Format class (Andreas Nüßlein)
|
||||
|
||||
|
||||
Bug fixes
|
||||
|
|
|
@ -13,6 +13,12 @@ class Format:
|
|||
self.classnames = classnames
|
||||
self.filter_spec = filter_spec
|
||||
|
||||
def __str__(self):
|
||||
return f'"{self.name}", "{self.label}", "{self.classnames}", "{self.filter_spec}"'
|
||||
|
||||
def __repr__(self):
|
||||
return f"Format({self})"
|
||||
|
||||
def editor_attributes(self, image, alt_text):
|
||||
"""
|
||||
Return additional attributes to go on the HTML element
|
||||
|
|
Ładowanie…
Reference in New Issue