@@ -260,20 +260,23 @@ cdef class InputFilter:
260260 inheritance chain."""
261261 cdef object cls , attr_value, conditions, validators, filters, base_cls
262262 cdef str attr_name
263- cdef list dir_attrs
264- cdef FieldDescriptor field_desc
265263 cdef set added_conditions, added_global_validators, added_global_filters
266264 cdef object condition_id, validator_id, filter_id
267265 cdef object condition, validator, filter_instance
268266
269267 cls = self .__class__
270- dir_attrs = dir (cls )
268+ added_conditions = set ()
269+ added_global_validators = set ()
270+ added_global_filters = set ()
271271
272- for attr_name in dir_attrs :
273- if attr_name.startswith( " _ " ) :
272+ for base_cls in reversed ( cls .__mro__) :
273+ if base_cls is object :
274274 continue
275- if hasattr (cls , attr_name):
276- attr_value = getattr (cls , attr_name)
275+
276+ for attr_name, attr_value in base_cls.__dict__ .items():
277+ if attr_name.startswith(" _" ):
278+ continue
279+
277280 if isinstance (attr_value, FieldDescriptor):
278281 self .fields[attr_name] = FieldModel(
279282 attr_value.required,
@@ -284,13 +287,9 @@ cdef class InputFilter:
284287 attr_value.steps,
285288 attr_value.external_api,
286289 attr_value.copy,
290+ attr_value.computed,
287291 )
288292
289- added_conditions = set ()
290- added_global_validators = set ()
291- added_global_filters = set ()
292-
293- for base_cls in reversed (cls .__mro__):
294293 conditions = getattr (base_cls, " _conditions" , None )
295294 if conditions is not None :
296295 for condition in conditions:
@@ -564,6 +563,7 @@ cdef class InputFilter:
564563 steps or [],
565564 external_api,
566565 copy,
566+ None , # computed (not supported in deprecated add method)
567567 )
568568
569569 cpdef bint has(self , str field_name):
@@ -689,6 +689,7 @@ cdef class InputFilter:
689689 steps or [],
690690 external_api,
691691 copy,
692+ None , # computed (not supported in deprecated add method)
692693 )
693694
694695 cpdef void add_global_filter(self , BaseFilter filter ):
0 commit comments