-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Showing the color in the list #8
Comments
I guess both a display helper and list filter could be added. While I find time to work on this you can use the following snippet. def display_color(obj):
return '<span style="width:5px;height:5px;color:%s"></span>' % obj.color
display_color.short_description = 'Color'
display_color.allow_tags = True Add add it as a callable (pass the object directly) to your |
Hi Simon, Thank you very much. |
That didn't show up for me in Grappelli admin fyi. Solved it like this (and actually I liked it better):
|
You should probably be using |
This worked worked for me on Django 4.2:
|
Hi,
I created a model with a RGBField.
Then I setted my model admin list_display to: ('color')
where color is my RGBField.
In the list of registered models, the rgb value for the selected color is shown.
Would be amazing if the view was something like the widget.
I do not know if it can be done directly in the django-colorful but if it is possible, it will be pretty cool.
The text was updated successfully, but these errors were encountered: