django_messages/management.py :
from django.db.models import get_models, signals
from django.conf import settings
from django.utils.translation import ugettext_noop as _
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("messages_received", _("Message Received"), _("you have received a message"), default=2)
notification.create_notice_type("messages_sent", _("Message Sent"), _("you have sent a message"), default=1)
notification.create_notice_type("messages_replied", _("Message Replied"), _("you have replied to a message"), default=1)
notification.create_notice_type("messages_reply_received", _("Reply Received"), _("you have received a reply to a message"), default=2)
notification.create_notice_type("messages_deleted", _("Message Deleted"), _("you have deleted a message"), default=1)
notification.create_notice_type("messages_recovered", _("Message Recovered"), _("you have undeleted a message"), default=1)
signals.post_syncdb.connect(create_notice_types, sender=notification)
else:
print "Skipping creation of NoticeTypes as notification app not found"
https://github.com/arneb/django-messages/blob/master/django_messages/management.py
종류는 여기에서 정의하고 post_syncdb 신호에 걸려있다.
글쎄, 지금 바보 같아. 나는 Eclipse/PyDev에서 .pyc 파일을 숨기고 이것을 보았다. 어떤 이유로 management.py는 없지만 management.pyc는 있습니다. 그게 정확히 내가 찾던 것이지, 단지 열심히 만만치 않다 ... :-( – gravelpot
오늘은 늦었 어. 맥주를 마실 시간이야! –