Skip to content
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

Declare manager class attributes on models as ClassVars #1672

Merged
merged 8 commits into from
Sep 5, 2023

Commits on Sep 2, 2023

  1. Move ModelBase.objects declaration to Model.objects, for mypy 1.5.0

    mypy 1.5.0 was fixed to understand that metaclass attributes take
    precedence over attributes in the regular class.  So we need to
    declare `objects` in the regular class to allow it to be overridden in
    subclasses.
    
    Fixes typeddjango#1648.
    
    Signed-off-by: Anders Kaseorg <[email protected]>
    andersk committed Sep 2, 2023
    Configuration menu
    Copy the full SHA
    fc3ef75 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2023

  1. Declare manager class attributes on models as ClassVars

    Inclusions:
    
    - Adjustments for the plugin to make generated managers `ClassVar`s
    - Changes the default 'objects' to 'ClassVar' and controls it via the
      plugin
    - Plugin ensures to only add the 'objects' manager to models it exists
      on during runtime
    flaeppe committed Sep 4, 2023
    Configuration menu
    Copy the full SHA
    662f4ee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cc1f7c9 View commit details
    Browse the repository at this point in the history
  3. Enforce appropriate keyword only arguments

    Co-authored-by: Nikita Sobolev <[email protected]>
    Petter Friberg and sobolevn authored Sep 4, 2023
    Configuration menu
    Copy the full SHA
    2393ed5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6919929 View commit details
    Browse the repository at this point in the history
  5. Bump mypy

    flaeppe committed Sep 4, 2023
    Configuration menu
    Copy the full SHA
    e96954f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7359fd0 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7e58520 View commit details
    Browse the repository at this point in the history