Changes between Initial Version and Version 1 of Ticket #28712, comment 7
- Timestamp:
- Oct 25, 2017, 10:45:57 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28712, comment 7
initial v1 1 1 Replying to [comment:6 Tim Graham]: 2 2 > I still don't find the example in the documentation particularly compelling. Instead of adding CSS classes for that case, I would use CSS [value=x] selectors. 3 The particular case that inspired me to create this issue is that I had a model and I wanted to create a choice widget for that model. I wanted each option to be styled such that it had a background image served from a different server such that I needed to construct an attribute of the form `style="background-image: url(https://somewhere.com/images/[id].png)"` where the ID was the model's ID. The problem was solved by extending the `Select` class and overriding the `create_option()` method. However, I feel it would have been more easily solved had the pull request I created been in place.3 The particular case that inspired me to create this issue is that I had a model and I wanted to create a choice widget for that model. I wanted each option to be styled such that it had a background image served from a different server such that I needed to construct an attribute of the form `style="background-image: url(https://somewhere.com/images/[id].png)"` where the ID was the object's ID. The problem was solved by extending the `Select` class and overriding the `create_option()` method. However, I feel it would have been more easily solved had the pull request I created been in place. 4 4 5 5 Still, I absolutely understand if you think this is too niche. Thus, if I haven't convinced you please feel free to close the issue!