Skip to content

Conversation

jeromecagado
Copy link

@jeromecagado jeromecagado commented Aug 7, 2024

Trac ticket number

ticket-35659

Branch description

Added documentation to explain the db_default behavior in the BooleanField class, ensuring users understand how default values are handled when Field.default isn't specified.

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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! Thank you for your contribution 💪

As it's your first contribution be sure to check out the patch review checklist.

If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!

If you have any design or process questions then you can ask in the Django forum.

Welcome aboard ⛵️!

@shangxiao
Copy link
Contributor

Appreciate the efforts but I'm not sure we want to document the behaviour in this manner.

Specifically we need to avoid the provided example of casting to bools which imho is misleading but more generally I think we need to have a discussion about whether we need a bit on DatabaseDefault (whether or not that sits in its own dedicated section or just a paragraph within this section).

Nobody will really need to instantiate anything of type DatabaseDefault but people will be exposed to it like we've seen in the ticket.

@sarahboyce sarahboyce changed the title Document db_default behavior in BooleanField Fixed #35659 -- Documented db_default behaviour before instances are saved. Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants