def __new__(mcs, name, bases, attrs): rv = SchemaMetaclass.__new__(mcs, name, bases, attrs) attrs['abstract'] = attrs.get('abstract', False) if not attrs['abstract'] and not attrs.get('connection'): mcs.concrete_classes.add(rv) if attrs.get('safe_insert') is not None: warn( ("safe_insert is deprecated. Use the write_concern_override " "instead."), DeprecationWarning, stacklevel=2, ) return rv
def __new__(cls, name, bases, attrs): rv = SchemaMetaclass.__new__(cls, name, bases, attrs) attrs['abstract'] = attrs.get('abstract', False) if not attrs['abstract'] and not attrs.get('connection'): cls.concrete_classes.add(rv) return rv