madslug

1
2
3
4
5
6
7
8
def madslug(title):
	title = title.strip(' ')
	name = sub('\s+', '_', title)
	name = sub('(?u)\W', '', name)
	name = sub('\d', '', name)
	name = sub('-+', '-', name)
	name = name.lower()
	return name

More like this

  1. . by jeremydw 1 year, 9 months ago
  2. default url routing and shortcut by vicalloy 2 years, 11 months ago
  3. watermark by dingdongquan 1 year, 4 months ago
  4. Templatetag to manage GET arguments in template by DimmuR 1 year, 6 months ago
  5. custom template tag sample by shinyzhu 2 years, 3 months ago

Comments

(Forgotten your password?)