<s> from uliweb import Finder , UliwebError , settings <EOL> from uliweb . utils . common import import_attr <EOL> validators = Finder ( '<STR_LIT>' ) <EOL> def get_form ( formcls ) : <EOL> """<STR_LIT>""" <EOL> from uliweb . form import Form <EOL> import inspect <EOL> if inspect . isclass ( formcls ) and issubclass ( formcls , Form ) : <EOL> return formcls <EOL> elif isinstance ( formcls , ( str , unicode ) ) : <EOL> path = settings . FORMS . get ( formcls ) <EOL> if path : <EOL> _cls = import_attr ( path ) <EOL> return _cls <EOL> else : <EOL> raise UliwebError ( "<STR_LIT>" % formcls ) <EOL> else : <EOL> raise UliwebError ( "<STR_LIT>" % formcls ) <EOL> def startup_installed ( sender ) : <EOL> from uliweb import settings <EOL> import uliweb . form . uliform as form <EOL> from uliweb . utils . common import import_attr <EOL> for k , v in settings . get_var ( '<STR_LIT>' , { } ) . items ( ) : <EOL> form . fields_mapping [ k ] = import_attr ( v ) </s>
