code: def prepareClasses(locals):
      
      for (name, forgetter) in locals.items():
          if not (type(forgetter) is types.TypeType and
                  issubclass(forgetter, Forgetter)):
              # Only care about Forgetter objects
              continue
  
          # Resolve classes
          for (key, userclass) in forgetter._userClasses.items():
              if type(userclass) is types.StringType:
                  # resolve from locals
                  resolved = locals[userclass]
                  forgetter._userClasses[key] = resolved
  
          forgetter._tables = {}
          # Update all fields with proper names
          for (field, sqlfield) in forgetter._sqlFields.items():
              forgetter._sqlFields[field] = forgetter._checkTable(sqlfield)
  
          newLinks = []
          for linkpair in forgetter._sqlLinks:
              (link1, link2) = linkpair
              link1=forgetter._checkTable(link1)
              link2=forgetter._checkTable(link2)
              newLinks.append((link1, link2))
  
          forgetter._sqlLinks = newLinks
          forgetter._prepared = True
docs: Fix _userClasses and some stuff in classes.
  
      Traverses locals, which is a locals() dictionary from
      the namespace where Forgetter subclasses have been
      defined, and resolves names in _userClasses to real
      class-references.
  
      Normally you would call forgettSQL.prepareClasses(locals())
      after defining all classes in your local module.
      prepareClasses will only touch objects in the name space
      that is a subclassed of Forgetter.