Skip to content

Instantly share code, notes, and snippets.

@Greymalkin
Created July 2, 2014 19:14
Show Gist options
  • Save Greymalkin/1990ec087ff39e4ef647 to your computer and use it in GitHub Desktop.
Save Greymalkin/1990ec087ff39e4ef647 to your computer and use it in GitHub Desktop.
Loop over an objects elements
# http://stackoverflow.com/questions/11637293/iterate-over-object-attributes-in-python
def __init__(self, *args, **kwargs):
print('***** init')
for a in args:
print(a)
for k in kwargs:
print (k)
print([a for a in dir(self) if not a.startswith('__')])
print self.formset
print([a for a in dir(self.formset) if not a.startswith('__')])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment