X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/0f2d00f9d7d5d28149707f66c719b28edfe51aed..49662df87328b4fb2f235c55eebe9d810ca17f82:/forum/models/__init__.py?ds=sidebyside diff --git a/forum/models/__init__.py b/forum/models/__init__.py index e835307..2c9c997 100644 --- a/forum/models/__init__.py +++ b/forum/models/__init__.py @@ -1,34 +1,28 @@ -from question import Question ,QuestionRevision, FavoriteQuestion, QuestionSubscription +from question import Question ,QuestionRevision, QuestionSubscription from answer import Answer, 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 node import Node, NodeRevision, NodeMetaClass, AnonymousNode +from user import User, ValidationHash, AuthKeyUserAssociation, SubscriptionSettings +from node import Node, NodeRevision, NodeMetaClass +from comment import Comment +from action import Action, ActionRepute +from meta import Vote, Flag, Badge, Award from utils import KeyValue try: from south.modelsinspector import add_introspection_rules - add_introspection_rules([], [r"^forum\.models\.utils\.\w+"]) + add_introspection_rules([], [r"^forum\.models\.\w+\.\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__ = [ - 'Node', 'NodeRevision', 'AnonymousNode', - 'Question', 'FavoriteQuestion', 'QuestionSubscription', 'QuestionRevision', + 'Node', 'NodeRevision', + 'Question', 'QuestionSubscription', 'QuestionRevision', 'Answer', 'AnswerRevision', - 'Tag', 'Comment', 'Vote', 'FlaggedItem', 'MarkedTag', 'LikedComment', 'Badge', 'Award', 'Repute', - 'Activity', 'ValidationHash', 'AuthKeyUserAssociation', 'SubscriptionSettings', 'KeyValue', 'User', + 'Tag', 'Comment', 'MarkedTag', 'Badge', 'Award', + 'ValidationHash', 'AuthKeyUserAssociation', 'SubscriptionSettings', 'KeyValue', 'User', + 'Action', 'ActionRepute', 'Vote', 'Flag' ] @@ -39,4 +33,5 @@ for k, v in get_modules_script_classes('models', models.Model).items(): __all__.append(k) exec "%s = v" % k -NodeMetaClass.setup_relations() \ No newline at end of file +NodeMetaClass.setup_relations() +BaseMetaClass.setup_denormalizes() \ No newline at end of file