On Tue, Oct 16, 2012 at 6:21 PM, Daniele Procida <dani...@vurt.org> wrote:
> I am starting to customise the admin classes for my models so that I can 
> provide extra feedback to the user.
>
> For example I want to report - in the admin page - useful information about 
> how the system will interpret the current state of the object being edited.
>
> I'm doing this by using readonly_fields, that contain the output of method on 
> the ModelAdmin class, a bit like this:
>
>     class PersonAdmin(ModelAdmin):
>         readonly_fields = ['check_address',]
>
>         def check_address(self, instance):
>             return instance.get_full_address or "<span 
> class='errors'>Warning: I am unable to work out an address for this 
> person.</span>"
>
> (the actual examples are rather more complex, but this is the idea).
>
> Does a more elegant way of doing this exist, either in Django's core already, 
> or using some package that makes it easier?
>
> Thanks,
>
> Daniele


I'm a curmudgeon.  I have to wonder how much work it is worth doing to
make the admin interface something that it is not before it is worth
using a custom view of your own.  Remember, views that you write can
do anything that the admin can do.

Bill

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to