@@ -100,9 +100,7 @@ def __new__(mcs, name, bases, attrs):
100100 meta = getattr (klass , 'Meta' )
101101 # Set klass.opts in __new__ rather than __init__ so that it is accessible in
102102 # get_declared_fields
103- klass .opts = klass .OPTIONS_CLASS (meta )
104- # Pass the inherited `ordered` into opts
105- klass .opts .ordered = ordered
103+ klass .opts = klass .OPTIONS_CLASS (meta , ordered = ordered )
106104 # Add fields specifid in the `include` class Meta option
107105 cls_fields += list (klass .opts .include .items ())
108106
@@ -179,7 +177,7 @@ def _resolve_processors(self):
179177class SchemaOpts (object ):
180178 """class Meta options for the :class:`Schema`. Defines defaults."""
181179
182- def __init__ (self , meta ):
180+ def __init__ (self , meta , ordered = False ):
183181 self .fields = getattr (meta , 'fields' , ())
184182 if not isinstance (self .fields , (list , tuple )):
185183 raise ValueError ("`fields` option must be a list or tuple." )
@@ -201,7 +199,7 @@ def __init__(self, meta):
201199 'Schema.dump will be excluded from the serialized output by default.' ,
202200 UserWarning
203201 )
204- self .ordered = getattr (meta , 'ordered' , False )
202+ self .ordered = getattr (meta , 'ordered' , ordered )
205203 self .index_errors = getattr (meta , 'index_errors' , True )
206204 self .include = getattr (meta , 'include' , {})
207205 self .load_only = getattr (meta , 'load_only' , ())
0 commit comments