Skip to content

Instantly share code, notes, and snippets.

@raelmax
Created April 16, 2012 18:16
Show Gist options
  • Save raelmax/2400462 to your computer and use it in GitHub Desktop.
Save raelmax/2400462 to your computer and use it in GitHub Desktop.
Gera uma lista com todos os atributos de um django model que começa com "f_"
def feed_attrs():
feed = Feed()
l = ()
for i in [k for k in dir(feed) if k.startswith('f_')]:
l.append((i.lower(), i))
return l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment