@login_required
@require_POST
def add_to_locale(request, locale_code, role):
    locale = get_object_or_404(Locale, locale=locale_code)

    if not _user_can_edit(request.user, locale):
        raise PermissionDenied

    form = AddUserForm(request.POST)
    if form.is_valid():
        for user in form.cleaned_data['users']:
            getattr(locale, ROLE_ATTRS[role]).add(user)
        msg = _('{users} added successfully!').format(
            users=request.POST.get('users'))
        messages.add_message(request, messages.SUCCESS, msg)
        return HttpResponseRedirect(locale.get_absolute_url())

    msg = _('There were errors adding users, see below.')
    messages.add_message(request, messages.ERROR, msg)
    return locale_details(request, locale_code, **{role + '_form': form})
1. map only subclass of class
dataset/ETHPy150Open mozilla/kitsune/kitsune/wiki/locale_views.py/add_to_locale--crossover with--dataset/ETHPy150Open zzzeek/sqlalchemy/test/orm/test_events.py/DeferredMapperEventsTest.test_deferred_map_event_subclass_post_mapping_propagate