Created
November 11, 2015 16:10
-
-
Save alex8224/aaa62be1be38b8a69f46 to your computer and use it in GitHub Desktop.
禁止PropertyPublisherMeta记录所有子类的字段信息
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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