<<<<<<< HEAD
def register(*models, **kwargs):
    """
    Registers the given model(s) classes and wrapped ModelAdmin class with
=======
def register(*models, site=None):
    """
    Register the given model(s) classes and wrapped ModelAdmin class with
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
    admin site:

    @register(Author)
    class AuthorAdmin(admin.ModelAdmin):
        pass

<<<<<<< HEAD
    A kwarg of `site` can be passed as the admin site, otherwise the default
    admin site will be used.
    """
    from django.contrib.admin import ModelAdmin
    from django.contrib.admin.sites import site, AdminSite
=======
    The `site` kwarg is an admin site to use instead of the default admin site.
    """
    from django.contrib.admin import ModelAdmin
    from django.contrib.admin.sites import site as default_site, AdminSite
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435

    def _model_admin_wrapper(admin_class):
        if not models:
            raise ValueError('At least one model must be passed to register.')

<<<<<<< HEAD
        admin_site = kwargs.pop('site', site)
=======
        admin_site = site or default_site
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435

        if not isinstance(admin_site, AdminSite):
            raise ValueError('site must subclass AdminSite')

        if not issubclass(admin_class, ModelAdmin):
            raise ValueError('Wrapped class must subclass ModelAdmin.')

        admin_site.register(models, admin_class=admin_class)

        return admin_class
    return _model_admin_wrapper
