Tuesday, June 21, 2011

Re: Strange value_from_object() return value (2L returned instead of unicode string)

On Tuesday, June 21, 2011 11:00:37 AM UTC-4, Tom Evans wrote:
On Tue, Jun 21, 2011 at 3:47 PM, Jeff Blaine <cjbl...@gmail.com> wrote:
> Any ideas?  I really want (concept)
> "myfield.unicode_representation_of_object(myobject)"
>

unicode(myobject.myfield) // unicode(getattr(myobject, 'myfield'))

Am I being dense?

Nope, you're just dealing with a newbie.  The second form works perfectly
for my needs.  Thanks! 

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

No comments:

Post a Comment