Chapter 12.1.1. Inside the sqlmeta cless

sqlmeta is a class instance that is attached as a class attribute to every model class that“s derived from SQLObject. This isn’t exactly intuitive, but it is necessary because of the metaclass hocus-pocus SQLObject uses to transparently provide you with all these nice services. The bottom line is that metaclass tricks deal with classes, so things you might normally do in your code with objects, SQLObject has to do with classes.

sqlmeta stores the column information, joins, and indexes of its corresponding model class in addition to some control parameters. There are three types of meta attributes:

  • Read-only (conceptually), which just provide meta information on the model class

  • Writable, which you can ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.