Created
July 2, 2014 19:14
-
-
Save Greymalkin/1990ec087ff39e4ef647 to your computer and use it in GitHub Desktop.
Loop over an objects elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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