Skip to content

Instantly share code, notes, and snippets.

@DevilsAutumn
Last active January 14, 2024 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save DevilsAutumn/61404f4cbfc583ced8dbc7a66d9de127 to your computer and use it in GitHub Desktop.
Save DevilsAutumn/61404f4cbfc583ced8dbc7a66d9de127 to your computer and use it in GitHub Desktop.
Google Summer Of Code 2023 Final Work Submission Report

Google Summer of Code 2023 Final Report

Project Goals

  • Make auto-detector generate migrations that allow moving a model between apps.
  • Write auto-detector tests to check if the operations generated to move a model are correct.
  • Write operations test to check if the set of operations generated by auto-detector actually moves a model correctly or not.
  • Add release note and document the new feature.

Project Goals Achieved

  • Work done

    • Created a new method in auto-detector which detects the moved model and automatically generates the migrations required to move that model to other model.
    • Wrote tests to check if the generated set of migrations by the auto-detector are correct.
    • Wrote test to check if the auto-generated migration operations actually move a model without any errors.
    • Created a demo-project to demonstrate and thoroughly test the working of the newly implemented feature.
    • Added a release note and short note on how moving a model between apps is handled by django.
  • Merged PRs

    While Testing the newly added feature, we came across a bug which made AlterField operation remake a table while renaming a related model with db_table. But since only the model name is changed and not table name(db_table), AlterField should be a noop. This was fixed in #17085.

  • Work Under Review

    • The new method generate_moved_model() to auto-detect moved model.
    • Tests
    • Documentation All in #16905

I would like to thank my mentor Mariusz Felisiak and Natalia Bidart for helping and guiding me whenever I got stuck. All the reviews were helpful and I learned a lot about the django internals from them.

Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment