The SingleObjectMixin.get_context_object_name method currently obtains
its value from the object's verbose name (when context_object_name is
None) :

smart_str(re.sub('[^a-zA-Z0-9]+', '_',
obj._meta.verbose_name.lower()))

When your object's verbose name is using ugettext, the template
context will contain the variable in one of the translated languages,
so if you're developing in an English locale , you'll make templates
using {{article}}, the next developer has a spanish locale and all his
templates will break as he'll get {{articulo}}.

I'm not sure what the right path here is, to have a default 'object'
or force the user to set a value, but using the verbose name seems to
be error prone.

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

Reply via email to