(self, name)
return slug
Helper method to convert camel case string (PumpernickelBread) to slug string (pumpernickel_bread)
Helper method to convert camel case string (PumpernickelBread) to slug string (pumpernickel_bread)
Helper method to convert camel case string ( PumpernickelBread ) to slug string ( pumpernickel_bread )
def camel_to_slug(self, name):
        """
            Helper method to convert camel case string (PumpernickelBread) to slug string (pumpernickel_bread)
        """
        name = re.sub(r'([a-z])([A-Z])', r'\1 \2', name).title().replace(" ", "").replace("_", "")
        s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
        slug = re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
        return slug
def camel_to_slug ( self , name ) : name = re . sub ( r'([a-z])([A-Z])' , r'\1 \2' , name ) . title ( ) . replace ( " " , "" ) . replace ( "_" , "" ) s1 = re . sub ( '(.)([A-Z][a-z]+)' , r'\1_\2' , name ) slug = re . sub ( '([a-z0-9])([A-Z])' , r'\1_\2' , s1 ) . lower ( ) return slug