X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/1a949f7c97dc2f34c135f5cdf088df2927d3d652..fa89c5511089b849ff9ed8bac9205b1e2abe6d03:/forum/models/__init__.py?ds=sidebyside diff --git a/forum/models/__init__.py b/forum/models/__init__.py index ef1e84b..7a15132 100644 --- a/forum/models/__init__.py +++ b/forum/models/__init__.py @@ -1,38 +1,38 @@ -from question import Question ,QuestionRevision, AnonymousQuestion, FavoriteQuestion, QuestionSubscription -from answer import Answer, AnonymousAnswer, AnswerRevision -from tag import Tag, MarkedTag -from meta import Vote, Comment, FlaggedItem, LikedComment -from user import User, Activity, ValidationHash, AuthKeyUserAssociation, SubscriptionSettings -from repute import Badge, Award, Repute -from utils import KeyValue - -try: - from south.modelsinspector import add_introspection_rules - add_introspection_rules([], [r"^forum\.models\.utils\.\w+"]) -except: - pass - -from base import * - -def is_new(sender, instance, **kwargs): - try: - instance._is_new = not bool(instance.id) - except: - pass - -pre_save.connect(is_new) - -__all__ = [ - 'Question', 'QuestionRevision', 'FavoriteQuestion', 'AnonymousQuestion', 'QuestionSubscription', - 'Answer', 'AnswerRevision', 'AnonymousAnswer', - 'Tag', 'Comment', 'Vote', 'FlaggedItem', 'MarkedTag', 'LikedComment', 'Badge', 'Award', 'Repute', - 'Activity', 'ValidationHash', 'AuthKeyUserAssociation', 'SubscriptionSettings', 'KeyValue', 'User', - ] - - -from forum.modules import get_modules_script_classes - -for k, v in get_modules_script_classes('models', models.Model).items(): - if not k in __all__: - __all__.append(k) - exec "%s = v" % k +from question import Question ,QuestionRevision, QuestionSubscription +from answer import Answer, AnswerRevision +from tag import Tag, MarkedTag +from user import User, ValidationHash, AuthKeyUserAssociation, SubscriptionSettings +from node import Node, NodeRevision, NodeState, NodeMetaClass +from comment import Comment +from action import Action, ActionRepute +from meta import Vote, Flag, Badge, Award +from utils import KeyValue +from page import Page + +try: + from south.modelsinspector import add_introspection_rules + add_introspection_rules([], [r"^forum\.models\.\w+\.\w+"]) +except: + pass + +from base import * + +__all__ = [ + 'Node', 'NodeRevision', 'NodeState', + 'Question', 'QuestionSubscription', 'QuestionRevision', + 'Answer', 'AnswerRevision', + 'Tag', 'Comment', 'MarkedTag', 'Badge', 'Award', + 'ValidationHash', 'AuthKeyUserAssociation', 'SubscriptionSettings', 'KeyValue', 'User', + 'Action', 'ActionRepute', 'Vote', 'Flag', 'Page' + ] + + +from forum.modules import get_modules_script_classes + +for k, v in get_modules_script_classes('models', models.Model).items(): + if not k in __all__: + __all__.append(k) + exec "%s = v" % k + +NodeMetaClass.setup_relations() +BaseMetaClass.setup_denormalizes() \ No newline at end of file