Google App Engine GAE is a platform-as-a-service PaaS that allows developers to build and host web applications on Googles infrastructure.
GAE provides a database model called db.Model for working with structured data.
Sometimes you may need to inspect the data type of a property in a db.Model class.
Pythons inspect module is a powerful tool that can help you achieve this.
In this tutorial we will explore how to use the inspect module to look up the data type of a property in a GAE db.Model class with a code example.
Before we get started make sure you have the following prerequisites in place:
The inspect module in Python provides functions to access and manipulate classes modules and objects at runtime.
It can be used to gather information about classes functions and modules and it is particularly helpful when working with dynamic and introspective programming.
We will use it to inspect the properties of a db.Model class in the context of Google App Engine.
Lets create a simple db.Model class and then use the inspect module to look up the data type of a property within that class.
Источник: rutube.ru