Skip to content

Commit

Permalink
Merge commit '27b68eff27f127fc1c4126d3d0b8be88fc87f060'
Browse files Browse the repository at this point in the history
  • Loading branch information
christofer holm committed Nov 12, 2024
2 parents a8423a4 + 27b68ef commit 30761f9
Show file tree
Hide file tree
Showing 4,342 changed files with 1,071 additions and 429,540 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 0 additions & 4 deletions pkg/MANIFEST.in

This file was deleted.

52 changes: 52 additions & 0 deletions pkg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Use Mongodb as a backend database for your django project, without changing a
single django model!

Usage
-----

1. Install djongo::

pip install djongo

2. Into settings.py file of your project, add::

DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': 'your-db-name',
}
}

3. Run (ONLY the first time to create collections in mongoDB)::

manage.py makemigrations
manage.py migrate

YOUR ARE SET! HAVE FUN!

Requirements
------------

1. Djongo requires python 3.6 or above.


How it works
------------

Djongo is a SQL to mongodb query transpiler. It translates a SQL query string
into a mongoDB query document. As a result, all Django features, models etc
work as is.

Django contrib modules::

'django.contrib.admin',
'django.contrib.auth',
'django.contrib.sessions',

and others... fully supported.

Important links
---------------

* `Full Documentation <https://www.djongomapper.com/>`_
* `Source code <https://github.com/doableware/djongo>`_
10 changes: 1 addition & 9 deletions pkg/djongo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
# This version of Djongo was made possible by
# the generous contributions from:
#
# * Zachary Sizemore
# * Wayne Van Son
# * Norman Niemer
# * Renz Ladia
# * thestick613

__version__ = '1.3.6'
__version__ = '1.3.7'
6 changes: 4 additions & 2 deletions pkg/djongo/introspection.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import collections
import datetime

import bson
from django.db.backends.base.introspection import BaseDatabaseIntrospection, FieldInfo, TableInfo
from django.db.models import Index
from logging import getLogger

logger = getLogger(__name__)


class DatabaseIntrospection(BaseDatabaseIntrospection):
Expand Down Expand Up @@ -41,7 +43,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
# return sorted(cursor.m_cli_connection.collection_names(False))

def get_table_list(self, cursor):

logger.debug(f'Introspection list table names')
return [
TableInfo(c, 't')
for c in cursor.db_conn.list_collection_names()
Expand Down
34 changes: 34 additions & 0 deletions pkg/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools"]

[project]
dynamic = ["version", "optional-dependencies"]
name = "djongo"
dependencies = [
'sqlparse==0.2.4',
'pymongo>=3.7.0,<=3.11.4',
'django>=2.1,<=3.1.12',
'pytz>=2018.5'
]
authors = [
{ name = "doableware", email = '[email protected]' }
]
license= {text = "AGPL"}
keywords = ["Django", "Djongo", "MongoDB", "driver", "connector"]
requires-python = ">=3.6"
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.6',
]
description = "Djongo: The Django MongoDB connector"
readme = "README.md"
[project.urls]
Homepage = "https://www.djongomapper.com/"
Documentation = "https://www.djongomapper.com/docs/"
Repository = "https://github.com/doableware/djongo.git"

[tool.setuptools.dynamic]
version = {attr = "djongo.__version__"}
2 changes: 0 additions & 2 deletions pkg/setup.cfg

This file was deleted.

120 changes: 0 additions & 120 deletions pkg/setup.py

This file was deleted.

1 change: 1 addition & 0 deletions pkg/tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.json
1 change: 1 addition & 0 deletions pkg/tests/django_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/
Loading

0 comments on commit 30761f9

Please sign in to comment.