Bad documentation of post_syncdb signal
|Reported by:||Vlastimil Zíma||Owned by:||Justin Lilly|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Signal post_sycndb is badly documented:
- documentation says that created_models is list, but emit_post_sync_signal is called with set when it is called from syncdb command. Surprisingly it is called with set from flush command, so there is probably error in code as well.
- documentation suggests that post_syncdb signal is called only when table is created, so it looks like you can use it to change database structure (create contraints, triggers, ...) These SQL fail when yout post_sycndb handler is called from flush, because flush does not change database structure (except SQLs with 'IF NOT EXISTS'-like conditions). Documentation should noted that handlers of this signal should not change database structure and for such cases customize sql hack in syncdb should be used.