djangosnippets.org: Latest snippets tagged with 'one-liners'https://djangosnippets.org/tags/one-liners/2008-02-05T14:27:38.885389-06:00Convert CamelCase to lowercase_with_underscores
2008-02-05T14:27:38.885389-06:00jdriscollhttps://djangosnippets.org/snippets/585/<p>Just a simple regex function to convert a camel case string ("ClassName") to a lower case string with underscores ("class_name"). Came across a need for this when I was trying to add properties to a model at runtime using <code>object.__class__.__name__</code>. This is a modification of the function "get_verbose_name" found …</p>
Freely redistributable