Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now generally available.

google.appengine.ext.db.to_dict

Convert model to dictionary.

model_instance Model instance for which to make dictionary.
dictionary dict instance or compatible to receive model values. The dictionary is not cleared of original values. Similar to using dictionary.update. If dictionary is None, a new dictionary instance is created and returned.

New dictionary appropriate populated with model instances values if entity is None, else entity.