On 06/20/2011 01:36 PM, Jeff Blaine wrote:
On Monday, June 20, 2011 11:56:00 AM UTC-4, Shawn Milochik wrote:
On 06/20/2011 11:54 AM, Jeff Blaine wrote:
> I'd like to make use of a field's verbose_name in some code
instead of
> duplicating that sort of info. Can someone show me how?
>
your_object._meta.verbose_name
Check out _meta in manage.py shell -- lots of good stuff in there.
That's the model's verbose_name
I want a field's verbose_name (see subject)
[ Thanks for replying though ]
Oops, I missed that. Still, my 'check out _meta' advice was spot on --
you can get the field verbose name from in there. Have you had a look at
the things available in the _meta of your model? Hint, try
get_field_by_name. I found it just now digging in there.
If there's an easier/cleaner way I hope someone else pipes in and
mentions it.
Shawn
--
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.