<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_custom_fields(cls, *args, **kw):
 """ Add any custom fields defined in the configuration. """

        for factory in config.custom_field_factories:
            for field in factory():
                setattr(cls, field.name, field)