<s> from __future__ import unicode_literals <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django . utils import six <EOL> from djangobmf . permissions import ModuleViewPermission <EOL> from djangobmf . views . mixins import BaseViewMixin <EOL> import re <EOL> class ViewMixinMetaclass ( type ) : <EOL> def __new__ ( cls , name , bases , attrs ) : <EOL> super_new = super ( ViewMixinMetaclass , cls ) . __new__ <EOL> parents = [ <EOL> b for b in bases if isinstance ( b , ViewMixinMetaclass ) and <EOL> not ( b . __name__ == '<STR_LIT>' and b . __mro__ == ( b , object ) ) <EOL> ] <EOL> if not parents : <EOL> return super_new ( cls , name , bases , attrs ) <EOL> new_cls = super_new ( cls , name , bases , attrs ) <EOL> if not hasattr ( new_cls , '<STR_LIT>' ) : <EOL> raise ImproperlyConfigured ( '<STR_LIT>' % new_cls ) <EOL> if not hasattr ( new_cls , '<STR_LIT>' ) : <EOL> raise ImproperlyConfigured ( '<STR_LIT>' % new_cls ) <EOL> if not hasattr ( new_cls , '<STR_LIT:name>' ) : <EOL> raise ImproperlyConfigured ( '<STR_LIT>' % new_cls ) <EOL> if not re . match ( '<STR_LIT>' , new_cls . slug ) : <EOL> raise ImproperlyConfigured ( '<STR_LIT>' % new_cls ) <EOL> if not hasattr ( new_cls , '<STR_LIT:key>' ) : <EOL> new_cls . key = new_cls . slug <EOL> return new_cls <EOL> class ViewMixin ( six . with_metaclass ( ViewMixinMetaclass , BaseViewMixin ) ) : <EOL> """<STR_LIT>""" <EOL> default_permission_classes = [ ModuleViewPermission ] <EOL> manager = None <EOL> date_resolution = None <EOL> permissions = None <EOL> template_name = None </s>
