#admin.py, you may create a new app, or put it in your "admin" app if you happen to have one.

from django.contrib import admin
from django.contrib.admin import widgets
from django.utils.translation import ugettext_lazy as _
from django import forms
from django.contrib.auth.models import Permission, Group
from django.db.models import Q
from django.conf import settings


def get_permissions():
    app_models_dict = {}

    for app_model in settings.GROUP_PERMISSIONS_MODELS:
        app, model = app_model.split(".")
        app_models_dict.setdefault(app, []).append(model)

    q = Q()

    for app, models in app_models_dict.iteritems():
        q |= Q(content_type__app_label=app, content_type__model__in=models)

    if q:
        return Permission.objects.filter(q)
    else:
        return Permission.objects.all()


class GroupAdminForm(forms.ModelForm):

    permissions = forms.ModelMultipleChoiceField(
        queryset=get_permissions(),
        widget=widgets.FilteredSelectMultiple(_('permissions'), False))

    class Meta:
        model = Group


class GroupAdmin(admin.ModelAdmin):

    form = GroupAdminForm
    search_fields = ('name', )
    ordering = ('name', )


admin.site.unregister(Group)
admin.site.register(Group, GroupAdmin)


# settings.py

GROUP_PERMISSIONS_MODELS = ['app1.modelname', 'app2.modelname', ]