\r
\r
node_create = django.dispatch.Signal(providing_args=['instance'])\r
+node_edit = django.dispatch.Signal(providing_args=['instance'])\r
\r
class Node(BaseModel, NodeContent, DeletableContent):\r
__metaclass__ = NodeMetaClass\r
self.body = revision.body\r
\r
old_revision = self.active_revision\r
-\r
self.active_revision = revision\r
- self.save()\r
\r
if not old_revision:\r
+ signal = node_create\r
+ else:\r
self.last_edited_at = datetime.datetime.now()\r
self.last_edited_by = user\r
- node_create.send(sender=self.__class__, instance=self)\r
+ signal = node_edit\r
+\r
+ self.save()\r
+ signal.send(sender=self.__class__, instance=self)\r
\r
def get_tag_list_if_changed(self):\r
dirty = self.get_dirty_fields()\r
@decorators.render('questions.html')
def question_search(request, keywords):
def question_search(keywords):
- return Question.objects.filter(Q(title__icontains=keywords) | Q(html__icontains=keywords))
+ return Question.objects.filter(Q(title__icontains=keywords) | Q(body__icontains=keywords))
from forum.modules import get_handler