MCPcopy
hub / github.com/django/django / _get_m2m_db_table

Method _get_m2m_db_table

django/db/models/fields/related.py:1987–1998  ·  view source on GitHub ↗

Function that can be curried to provide the m2m table name for this relation.

(self, opts)

Source from the content-addressed store, hash-verified

1985 return self.get_reverse_path_info()
1986
1987 def _get_m2m_db_table(self, opts):
1988 """
1989 Function that can be curried to provide the m2m table name for this
1990 relation.
1991 """
1992 if self.remote_field.through is not None:
1993 return self.remote_field.through._meta.db_table
1994 elif self.db_table:
1995 return self.db_table
1996 else:
1997 m2m_table_name = "%s_%s" % (utils.strip_quotes(opts.db_table), self.name)
1998 return utils.truncate_name(m2m_table_name, connection.ops.max_name_length())
1999
2000 def _get_m2m_attr(self, related, attr):
2001 """

Calls 1

max_name_lengthMethod · 0.45

Tested by

no test coverage detected