2012-04-02 7 views
0

ジャンゴ通知emit_noticesが私の通知で何もする必要はありいけない複数の余分なクエリを出力し、なぜだから私は把握しようとしてきた私はインタプリタで実行django-notification emit_notices余分なSQLクエリ?

をキュー:その後、

notification.queue([to_user], "new_msg", {"from_user": from_user}, sender=from_user) 

python manage.py emit_notices 

------------------------------------------------------------------------ 
acquiring lock... 
acquired. 
(0.001) SELECT `notification_noticequeuebatch`.`id`, `notification_noticequeuebatch`.`pickled_data` FROM `notification_noticequeuebatch`; args=() 
(0.001) SELECT `auth_user`.`id`, `auth_user`.`username`, `auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`email`, `auth_user`.`password`, `auth_user`.`is_staff`, `auth_user`.`is_active`, `auth_user`.`is_superuser`, `auth_user`.`last_login`, `auth_user`.`date_joined` FROM `auth_user` WHERE `auth_user`.`id` = 3 ; args=(3,) 
emitting notice new_msg to userTest 
(0.000) SELECT `notification_noticetype`.`id`, `notification_noticetype`.`label`, `notification_noticetype`.`display`, `notification_noticetype`.`description`, `notification_noticetype`.`default` FROM `notification_noticetype` WHERE `notification_noticetype`.`label` = new_msg ; args=('new_msg',) 
(0.000) SELECT `django_site`.`id`, `django_site`.`domain`, `django_site`.`name` FROM `django_site` WHERE `django_site`.`id` = 1 ; args=(1,) 
(0.001) SELECT `cities_city`.`id`, `cities_city`.`name` FROM `cities_city`; args=() 

上記のnotification.queue()とは関係のないその他のSQLクエリ(最後の1つはcities_cityから選択してください)があります。

emit_notices send_all()の呼び出しとsend_all()は、私は私のプロジェクトの全く別のアプリで都市との関係を参照してくださいいけない

send_now([to_user], label, extra_context, on_site, sender) 

を呼び出します。

しかし、それは動作しますが、私はなぜこれが起こっているのか把握したいと思います。私は何か間違っているのですか?

乾杯

答えて

0

私はこれらのクエリが通知テンプレートレンダリングによって生成されると確信しています。

+0

私もそれについて考えました。テンプレートから{{中括弧付き}}を削除しました...まだクエリを取得しています。これがあなたが言っているものなら.. – marlboro

+0

何について{%%}?テンプレートから**すべて**を削除して確認してください。 – jpic

+0

私はそれでもまだデフォルトのものを送ります。サイトパッケージ/ djang_notificationからデフォルトのものを切り捨てました。余分なクエリはまだ出力されています...新しくインストールするつもりだと思います行く – marlboro

関連する問題