Skip to content

Ticket 35453 fix m2m concrete #19701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Jkhall81
Copy link
Contributor

@Jkhall81 Jkhall81 commented Aug 3, 2025

Trac ticket number

ticket-35453

Branch description

This change ensures that ManyToManyField.concrete returns False, reflecting the fact that M2M fields do not correspond to a concrete database column. This aligns with expectations and avoids confusion when introspecting model fields.

A new test was added to assert that .concrete is False for M2M fields.

To support this behavior without breaking model field setup (where .concrete is unconditionally assigned), a property with a no-op setter was used that forces concrete to remain False even when Django tries to assign to it.

This avoids a crash during model initialization and ensures that schema-related logic (e.g., field lateration checks) treat M2M fields correctly.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

@github-actions github-actions bot added the no ticket Based on PR title, no linked Trac ticket label Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no ticket Based on PR title, no linked Trac ticket
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant