def auto_register(models_module):
    from django.contrib import admin
    from django.db import models
    from django.core.exceptions import ImproperlyConfigured
    variables = dir(models_module)
    variables = filter(lambda x: not x.startswith('__'), variables)
    for x in variables:
        value = getattr(models_module, x)
        try:
            model_class = issubclass(value, models.Model)
        except __HOLE__, e:
            model_class = False
        if model_class:
            try:
                admin_config = auto_configure_admin(value)
                admin.site.register(value, admin_config)
            except Exception, e:
                logger.info('couldnt register %s to the admin', value)
dataset/ETHPy150Open tbarbugli/stream_framework_example/core/utils/admin.py/auto_register