def __new__(mcs, name, bases, attrs):
        meta = attrs.pop('Meta', None)
        new_class = type.__new__(mcs, name, bases, attrs)

        if meta:
            meta.model_name = name.lower()
            meta.concrete_model = new_class
            setattr(new_class, '_meta', meta)
        else:
            raise AttributeError('Class %s has no "class Meta" definition' % name)

        return new_class