2👍
✅
The table name for a model is available via Model._meta.db_table
, and you can get to the through table for an M2M field via Model.field.through
. So, in your case:
MyModel.shared.through._meta.db_table
Source:stackexchange.com