Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

poc: convert from custom Django mongo backend to official one#18

Closed
gersmann wants to merge 7 commits intomainfrom
chore/adapt-mongo-provider/sg
Closed

poc: convert from custom Django mongo backend to official one#18
gersmann wants to merge 7 commits intomainfrom
chore/adapt-mongo-provider/sg

Conversation

@gersmann
Copy link
Contributor

@gersmann gersmann commented Aug 5, 2025

PoC for the conversion from this custom backend to the official MongoDB Django backend.

  • 'Dotted db_column: This backend supports dotted path db_column name for legacy data integration, the official one does not. This PoC 'monkey-patches' the official implementation. We could try to contribute a patch upstream, if the maintainers are willing to accept it.
  • Search: this backend allows switching filter predicates to using the search index. The official backend does not and it doesn't make sense to customize this IMO. We'd have to manually convert the lookups, where we currently rely on it to using a raw aggregation stage.

As a pre-caution the patcher calculates the method hash and verifies that the methods are unchanged.

@gersmann gersmann force-pushed the chore/adapt-mongo-provider/sg branch from 64962cb to 66a5552 Compare August 5, 2025 08:04
- Add django-mongodb-backend to dev dependencies
- Make MongoDB port configurable via MONGODB_PORT env var
- Add MONGODB_PORT to CI workflow and tox passenv
- Add uv and pytest to tox allowlist_externals
- Import os module in settings for environment variable access
django-mongodb-backend 5.2.0b1 is only compatible with Django 5.2,
not with Django 5.0 or 5.1. Commenting out these test environments
until version-specific packages can be configured.
tox-gh overrides env_list with its own configuration. Updated the
[tool.tox.gh.python] section to only run django52 environment
since django-mongodb-backend 5.2.0b1 is incompatible with Django 5.0/5.1.
@gersmann gersmann closed this Sep 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant