code: def html_state(self):
          
          ret = ""
          state = json.loads(self.state)
          for (app, appstate) in state.items():
              for (model, modelstate) in appstate.items():
                  ret += "<p>%s.models.%s</p>" % (app, model,)
                  ret += "<ul>"
                  for field in modelstate["fields"] + ["uid"]:
                      ret += "<li>%s</li>" % field
                  for fk in modelstate["foreignkeys"]:
                      ret += "<li>%s (foreign key)</li>" % fk
                  ret += "</ul>"
          return ret
docs: Display state in HTML format for the admin form.