Skip to content

Instantly share code, notes, and snippets.

@alex8224
Created November 11, 2015 16:10
Show Gist options
  • Save alex8224/aaa62be1be38b8a69f46 to your computer and use it in GitHub Desktop.
Save alex8224/aaa62be1be38b8a69f46 to your computer and use it in GitHub Desktop.
禁止PropertyPublisherMeta记录所有子类的字段信息
class PropertyPublisherMeta(type):
"""A metaclass that associates subclasses with Storm L{PropertyRegistry}s.
"""
def __init__(self, name, bases, dict):
if not hasattr(self, "_storm_property_registry"):
self._storm_property_registry = PropertyRegistry()
elif hasattr(self, "__storm_table__") and hasattr(self, "__refbyname__"):
refbyname = getattr(self, "__refbyname__")
if refbyname:
self._storm_property_registry.add_class(self)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment