def iter_subclasses(cls, _seen=None, template_classes=[]):
 if (not isinstance(cls, type)):
  raise TypeError(('itersubclasses must be called with new-style classes, not %.100r' % cls))
 if (_seen is None):
  _seen = set()
 try:
  subs = cls.__subclasses__()
 except TypeError:
  subs = cls.__subclasses__(cls)
 for sub in subs:
  if ((sub not in _seen) and (sub.__name__ not in template_classes)):
   _seen.add(sub)
   (yield sub)
  for sub in iter_subclasses(sub, _seen, template_classes):
   (yield sub)

def iter_subclasses ( cls , _seen = None , template_classes = [ ] ) : if ( not isinstance ( cls , type ) ) : raise TypeError ( ( 'itersubclasses must be called with new-style classes, not %.100r' % cls ) ) if ( _seen is None ) : _seen = set ( ) try : subs = cls . __subclasses__ ( ) except TypeError : subs = cls . __subclasses__ ( cls ) for sub in subs : if ( ( sub not in _seen ) and ( sub . __name__ not in template_classes ) ) : _seen . add ( sub ) ( yield sub ) for sub in iter_subclasses ( sub , _seen , template_classes ) : ( yield sub )
generator to iterate over all the subclasses of model .