From 54880b5de1512fa53609efd13c92fb82c21c4367 Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Wed, 9 Sep 2020 21:35:42 +0200 Subject: [PATCH] Autorenaming, changed deps to caosdb --- .github/FUNDING.yml | 12 ------ .travis.yml | 26 ------------ ISSUE_TEMPLATE.md | 14 ------ MANIFEST | 30 ++++++------- MANIFEST.in | 8 ++-- README.md | 22 +++++----- {djongo => djaosdb}/__init__.py | 0 {djongo => djaosdb}/admin.py | 2 +- {djongo => djaosdb}/base.py | 10 ++--- {djongo => djaosdb}/compiler.py | 0 {djongo => djaosdb}/creation.py | 0 {djongo => djaosdb}/cursor.py | 0 {djongo => djaosdb}/database.py | 2 +- .../dynamic_formsets/__init__.py | 0 {djongo => djaosdb}/dynamic_formsets/apps.py | 2 +- .../static/dynamic_formsets/images/add.png | Bin .../static/dynamic_formsets/images/delete.png | Bin .../js/jquery-formset/jquery.formset.js | 0 .../js/jquery-formset/jquery.formset.min.js | 0 .../dynamic_formsets/js/jquery/jquery.js | 0 .../dynamic_formsets/js/jquery/jquery.min.js | 0 .../dynamic_formsets/js/jquery/jquery.min.map | 0 .../dynamic_formsets/js/jquery/jquery.slim.js | 0 .../js/jquery/jquery.slim.min.js | 0 .../js/jquery/jquery.slim.min.map | 0 .../templates/admin/change_form.html | 0 .../dynamic_formsets/templatetags/__init__.py | 0 .../templatetags/formset_tags.py | 2 +- {djongo => djaosdb}/exceptions.py | 6 +-- {djongo => djaosdb}/features.py | 2 +- {djongo => djaosdb}/introspection.py | 6 +-- {djongo => djaosdb}/models/__init__.py | 0 {djongo => djaosdb}/models/fields.py | 12 +++--- djaosdb/models/indexes.py | 1 + {djongo => djaosdb}/models/json.py | 2 +- {djongo => djaosdb}/operations.py | 0 {djongo => djaosdb}/schema.py | 0 {djongo => djaosdb}/sql2mongo/__init__.py | 0 djaosdb/sql2mongo/aggregation.py | 4 ++ djaosdb/sql2mongo/constraints.py | 5 +++ {djongo => djaosdb}/sql2mongo/converters.py | 0 {djongo => djaosdb}/sql2mongo/functions.py | 0 {djongo => djaosdb}/sql2mongo/operators.py | 0 {djongo => djaosdb}/sql2mongo/query.py | 34 +++++++-------- {djongo => djaosdb}/sql2mongo/sql_tokens.py | 10 ++--- {djongo => djaosdb}/sql2mongo/validation.py | 2 +- {djongo => djaosdb}/storage.py | 0 djaosdb/transaction.py | 5 +++ djongo/models/indexes.py | 1 - djongo/sql2mongo/aggregation.py | 4 -- djongo/sql2mongo/constraints.py | 5 --- djongo/transaction.py | 5 --- docs/_config.yml | 6 +-- docs/_data/navigation.yml | 24 +++++------ docs/_data/navigation2.yml | 4 +- docs/_includes/links | 2 +- docs/_includes/pizza.html | 2 +- docs/_includes/vendors/stripe.html | 2 +- docs/assets/images/banner.svg | 4 +- docs/assets/images/layers.svg | 2 +- docs/assets/images/orm2odm.svg | 2 +- docs/assets/images/sql2mongodb.svg | 4 +- docs/docs/Discuss.md | 2 +- ...t-ways-to-integrate-django-with-mongodb.md | 14 +++--- ...jango-mongodb-connector-design-document.md | 2 +- docs/docs/djongo-deep-dive.md | 34 +++++++-------- ...ting-django-capped-models-using-mongodb.md | 4 +- docs/docs/djongonxt/djongonxt-aggregation.md | 2 +- .../djongonxt-database-transactions.md | 6 +-- docs/docs/djongonxt/djongonxt-indexes.md | 40 +++++++++--------- .../djongonxt/djongonxt-model-creation.md | 20 ++++----- docs/docs/djongonxt/djongonxt-model-query.md | 26 ++++++------ docs/docs/djongonxt/djongonxt-model-update.md | 8 ++-- docs/docs/djongonxt/djongonxt-more-info.md | 2 +- docs/docs/djongonxt/djongonxt.md | 2 +- .../using-django-with-mongodb-array-field.md | 10 ++--- .../using-django-with-mongodb-data-fields.md | 14 +++--- docs/docs/get-started.md | 20 ++++----- docs/docs/home.md | 18 ++++---- docs/docs/sponsor.md | 2 +- docs/docs/using-django-with-mongodb-gridfs.md | 4 +- no-response.yml | 10 ----- requirements.txt | 2 +- setup.py | 18 ++++---- .../test_utils/settings/test_mongodb.py | 4 +- tests/django_tests/test_utils/test_runner.py | 4 +- .../django_tests/tests/v22/tests/runtests.py | 2 +- .../test_project/settings/settings_lite.py | 6 +-- .../test_project/settings/settings_loaded.py | 10 ++--- .../settings/settings_loaded_formsets.py | 8 ++-- .../settings/settings_precheckin.py | 4 +- .../xtest_app/models/admin_tests.py | 2 +- .../xtest_app/models/basic_field.py | 2 +- .../xtest_app/models/canvas_models_id.py | 2 +- .../xtest_app/models/reference_field.py | 2 +- .../test_project/xtest_app/tests/__init__.py | 6 +-- .../xtest_app/tests/test_canvas.py | 2 +- .../xtest_app/tests/test_models.py | 4 +- tests/mock_tests/test_sqlparsing.py | 16 +++---- tests/precheckin.py | 6 +-- 100 files changed, 282 insertions(+), 344 deletions(-) delete mode 100644 .github/FUNDING.yml delete mode 100644 .travis.yml delete mode 100644 ISSUE_TEMPLATE.md rename {djongo => djaosdb}/__init__.py (100%) rename {djongo => djaosdb}/admin.py (96%) rename {djongo => djaosdb}/base.py (97%) rename {djongo => djaosdb}/compiler.py (100%) rename {djongo => djaosdb}/creation.py (100%) rename {djongo => djaosdb}/cursor.py (100%) rename {djongo => djaosdb}/database.py (96%) rename {djongo => djaosdb}/dynamic_formsets/__init__.py (100%) rename {djongo => djaosdb}/dynamic_formsets/apps.py (75%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/images/add.png (100%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/images/delete.png (100%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.js (100%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.min.js (100%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.js (100%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.js (100%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.map (100%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.js (100%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.js (100%) rename {djongo => djaosdb}/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.map (100%) rename {djongo => djaosdb}/dynamic_formsets/templates/admin/change_form.html (100%) rename {djongo => djaosdb}/dynamic_formsets/templatetags/__init__.py (100%) rename {djongo => djaosdb}/dynamic_formsets/templatetags/formset_tags.py (84%) rename {djongo => djaosdb}/exceptions.py (81%) rename {djongo => djaosdb}/features.py (87%) rename {djongo => djaosdb}/introspection.py (96%) rename {djongo => djaosdb}/models/__init__.py (100%) rename {djongo => djaosdb}/models/fields.py (98%) create mode 100644 djaosdb/models/indexes.py rename {djongo => djaosdb}/models/json.py (87%) rename {djongo => djaosdb}/operations.py (100%) rename {djongo => djaosdb}/schema.py (100%) rename {djongo => djaosdb}/sql2mongo/__init__.py (100%) create mode 100644 djaosdb/sql2mongo/aggregation.py create mode 100644 djaosdb/sql2mongo/constraints.py rename {djongo => djaosdb}/sql2mongo/converters.py (100%) rename {djongo => djaosdb}/sql2mongo/functions.py (100%) rename {djongo => djaosdb}/sql2mongo/operators.py (100%) rename {djongo => djaosdb}/sql2mongo/query.py (97%) rename {djongo => djaosdb}/sql2mongo/sql_tokens.py (97%) rename {djongo => djaosdb}/sql2mongo/validation.py (67%) rename {djongo => djaosdb}/storage.py (100%) create mode 100644 djaosdb/transaction.py delete mode 100644 djongo/models/indexes.py delete mode 100644 djongo/sql2mongo/aggregation.py delete mode 100644 djongo/sql2mongo/constraints.py delete mode 100644 djongo/transaction.py delete mode 100644 no-response.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 0c420b9..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: nesdis -patreon: -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: https://nesdis.github.io/djongo/sponsor/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dbf6e3e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: python - -python: - - 3.8 - -env: - matrix: - - MONGODB=4.2.6 - -install: - - wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - - - echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list - - sudo apt-get update - - sudo apt-get install -y mongodb-org=${MONGODB} mongodb-org-server=${MONGODB} mongodb-org-shell=${MONGODB} mongodb-org-mongos=${MONGODB} mongodb-org-tools=${MONGODB} --allow-downgrades - - sudo service mongod start - - sudo service mongod status - - pip install tox - -before_script: - - mongod --version - -script: - - tox -e py38-django_stable - -after_script: - - pkill mongod \ No newline at end of file diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index 4f305e9..0000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,14 +0,0 @@ - -#### One line description of the issue - -#### Python script - -<The complete python script used to produce the issue.> - -```python -<copy and paste code here> - -``` - -#### Traceback -<The complete stack trace of the error.> diff --git a/MANIFEST b/MANIFEST index f1161b1..944f8bf 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,18 +1,18 @@ # file GENERATED by distutils, do NOT edit setup.cfg setup.py -djongo\__init__.py -djongo\base.py -djongo\compiler.py -djongo\cursor.py -djongo\database.py -djongo\features.py -djongo\introspection.py -djongo\operations.py -djongo\schema.py -djongo\models\__init__.py -djongo\models\fields.py -djongo\sql2mongo\__init__.py -djongo\sql2mongo\converters.py -djongo\sql2mongo\operators.py -djongo\sql2mongo\query.py +djaosdb\__init__.py +djaosdb\base.py +djaosdb\compiler.py +djaosdb\cursor.py +djaosdb\database.py +djaosdb\features.py +djaosdb\introspection.py +djaosdb\operations.py +djaosdb\schema.py +djaosdb\models\__init__.py +djaosdb\models\fields.py +djaosdb\sql2mongo\__init__.py +djaosdb\sql2mongo\converters.py +djaosdb\sql2mongo\operators.py +djaosdb\sql2mongo\query.py diff --git a/MANIFEST.in b/MANIFEST.in index 7f32d83..a20f209 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include djongo/dynamic_formsets/static/dynamic_formsets/images/*.* -include djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/*.* -include djongo/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/*.* -include djongo/dynamic_formsets/templates/admin/*.* +include djaosdb/dynamic_formsets/static/dynamic_formsets/images/*.* +include djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/*.* +include djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/*.* +include djaosdb/dynamic_formsets/templates/admin/*.* diff --git a/README.md b/README.md index a49d1fa..ea3ffc9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -<h1>djongo</h1> +<h1>djaosdb</h1> -[](https://travis-ci.com/nesdis/djongo) +[](https://travis-ci.com/nesdis/djaosdb) [](https://www.gnu.org/licenses/agpl-3.0) -<a href="https://badge.fury.io/py/djongo"><img src="https://badge.fury.io/py/djongo.svg" alt="PyPI version" height="18"></a> +<a href="https://badge.fury.io/py/djaosdb"><img src="https://badge.fury.io/py/djaosdb.svg" alt="PyPI version" height="18"></a> ## The only connector that let's you use Django with MongoDB *without* changing the Django ORM @@ -10,10 +10,10 @@ Use MongoDB as a backend database for your Django project, without changing the ## Usage: <ol> -<li> Install djongo: +<li> Install djaosdb: ``` -pip install djongo +pip install djaosdb ``` </li> <li> Into settings.py file of your project, add: @@ -21,7 +21,7 @@ pip install djongo ```python DATABASES = { 'default': { - 'ENGINE': 'djongo', + 'ENGINE': 'djaosdb', 'NAME': 'your-db-name', 'CLIENT': { 'host': 'your-db-host', @@ -52,7 +52,7 @@ I am inundated daily with your love, appreciation, queries and feature requests ## How it works -djongo is a SQL to mongodb query compiler. It translates a SQL query string into a mongoDB query document. As a result, all Django features, models etc work as is. +djaosdb is a SQL to mongodb query compiler. 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: <pre><code> @@ -70,19 +70,19 @@ djongo is a SQL to mongodb query compiler. It translates a SQL query string into * Embedded Array. * Embedded Form Fields. - Read the [full documentation](https://nesdis.github.io/djongo/) + Read the [full documentation](https://nesdis.github.io/djaosdb/) ## Contribute - If you think djongo is useful, **please share it** with the world! Your endorsements and online reviews will help get more support for this project. + If you think djaosdb is useful, **please share it** with the world! Your endorsements and online reviews will help get more support for this project. - Take a look at the [Enhancements project](https://github.com/nesdis/djongo/projects/1) that contains a list of features that must be implemented in future versions of Djongo. You can contribute to the source code or the documentation by creating a simple pull request! You may want to refer to the design documentation to get an idea on how [Django MongoDB connector](https://nesdis.github.io/djongo/django-mongodb-connector-design-document/) is implemented. + Take a look at the [Enhancements project](https://github.com/nesdis/djaosdb/projects/1) that contains a list of features that must be implemented in future versions of Djongo. You can contribute to the source code or the documentation by creating a simple pull request! You may want to refer to the design documentation to get an idea on how [Django MongoDB connector](https://nesdis.github.io/djaosdb/django-mongodb-connector-design-document/) is implemented. Add a star, show some love :) ## Questions and Discussion - * [Djongo groups](https://groups.google.com/d/forum/djongo) is where you can watch for new release announcements, suggest improvements, and discuss topics pertaining to Django and MongoDB. + * [Djongo groups](https://groups.google.com/d/forum/djaosdb) is where you can watch for new release announcements, suggest improvements, and discuss topics pertaining to Django and MongoDB. * Issues, where things are not working as expected, please raise a git-hub issue ticket. * For questions and clarifications regarding usage, please put it up on stackoverflow instead. diff --git a/djongo/__init__.py b/djaosdb/__init__.py similarity index 100% rename from djongo/__init__.py rename to djaosdb/__init__.py diff --git a/djongo/admin.py b/djaosdb/admin.py similarity index 96% rename from djongo/admin.py rename to djaosdb/admin.py index 91cdf7c..f4a89b6 100644 --- a/djongo/admin.py +++ b/djaosdb/admin.py @@ -1,7 +1,7 @@ import copy from django.contrib import admin -from djongo.models import fields +from djaosdb.models import fields class ModelAdmin(admin.ModelAdmin): diff --git a/djongo/base.py b/djaosdb/base.py similarity index 97% rename from djongo/base.py rename to djaosdb/base.py index 6dab52e..9fdff29 100644 --- a/djongo/base.py +++ b/djaosdb/base.py @@ -102,7 +102,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): 'iendswith': 'iLIKE %s', } - vendor = 'djongo' + vendor = 'djaosdb' SchemaEditorClass = DatabaseSchemaEditor Database = Database @@ -114,7 +114,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): def __init__(self, *args, **kwargs): self.client_connection = None - self.djongo_connection = None + self.djaosdb_connection = None super().__init__(*args, **kwargs) def is_usable(self): @@ -134,7 +134,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): 'ENFORCE_SCHEMA': 'enforce_schema', } connection_params = { - 'name': 'djongo_test', + 'name': 'djaosdb_test', 'enforce_schema': False } for setting_name, kwarg in valid_settings.items(): @@ -177,7 +177,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): logger.debug('New Database connection') database = self.client_connection[name] - self.djongo_connection = DjongoClient(database, es) + self.djaosdb_connection = DjongoClient(database, es) return self.client_connection[name] def _set_autocommit(self, autocommit): @@ -199,7 +199,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): """ Returns an active connection cursor to the database. """ - return Cursor(self.client_connection, self.connection, self.djongo_connection) + return Cursor(self.client_connection, self.connection, self.djaosdb_connection) def _close(self): """ diff --git a/djongo/compiler.py b/djaosdb/compiler.py similarity index 100% rename from djongo/compiler.py rename to djaosdb/compiler.py diff --git a/djongo/creation.py b/djaosdb/creation.py similarity index 100% rename from djongo/creation.py rename to djaosdb/creation.py diff --git a/djongo/cursor.py b/djaosdb/cursor.py similarity index 100% rename from djongo/cursor.py rename to djaosdb/cursor.py diff --git a/djongo/database.py b/djaosdb/database.py similarity index 96% rename from djongo/database.py rename to djaosdb/database.py index 86ad27d..cfa4f52 100644 --- a/djongo/database.py +++ b/djaosdb/database.py @@ -1,5 +1,5 @@ from logging import getLogger -from pymongo import MongoClient +from caosdb import MongoClient logger = getLogger(__name__) clients = {} diff --git a/djongo/dynamic_formsets/__init__.py b/djaosdb/dynamic_formsets/__init__.py similarity index 100% rename from djongo/dynamic_formsets/__init__.py rename to djaosdb/dynamic_formsets/__init__.py diff --git a/djongo/dynamic_formsets/apps.py b/djaosdb/dynamic_formsets/apps.py similarity index 75% rename from djongo/dynamic_formsets/apps.py rename to djaosdb/dynamic_formsets/apps.py index f8ab97e..d3b134e 100644 --- a/djongo/dynamic_formsets/apps.py +++ b/djaosdb/dynamic_formsets/apps.py @@ -2,5 +2,5 @@ from django.apps import AppConfig class DynamicFormsetsConfig(AppConfig): - name = 'djongo.dynamic_formsets' + name = 'djaosdb.dynamic_formsets' verbose_name = 'Dynamic Formsets' diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/images/add.png b/djaosdb/dynamic_formsets/static/dynamic_formsets/images/add.png similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/images/add.png rename to djaosdb/dynamic_formsets/static/dynamic_formsets/images/add.png diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/images/delete.png b/djaosdb/dynamic_formsets/static/dynamic_formsets/images/delete.png similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/images/delete.png rename to djaosdb/dynamic_formsets/static/dynamic_formsets/images/delete.png diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.js b/djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.js similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.js rename to djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.js diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.min.js b/djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.min.js similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.min.js rename to djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery-formset/jquery.formset.min.js diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.js b/djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.js similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.js rename to djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.js diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.js b/djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.js similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.js rename to djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.js diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.map b/djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.map similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.map rename to djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.min.map diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.js b/djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.js similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.js rename to djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.js diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.js b/djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.js similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.js rename to djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.js diff --git a/djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.map b/djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.map similarity index 100% rename from djongo/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.map rename to djaosdb/dynamic_formsets/static/dynamic_formsets/js/jquery/jquery.slim.min.map diff --git a/djongo/dynamic_formsets/templates/admin/change_form.html b/djaosdb/dynamic_formsets/templates/admin/change_form.html similarity index 100% rename from djongo/dynamic_formsets/templates/admin/change_form.html rename to djaosdb/dynamic_formsets/templates/admin/change_form.html diff --git a/djongo/dynamic_formsets/templatetags/__init__.py b/djaosdb/dynamic_formsets/templatetags/__init__.py similarity index 100% rename from djongo/dynamic_formsets/templatetags/__init__.py rename to djaosdb/dynamic_formsets/templatetags/__init__.py diff --git a/djongo/dynamic_formsets/templatetags/formset_tags.py b/djaosdb/dynamic_formsets/templatetags/formset_tags.py similarity index 84% rename from djongo/dynamic_formsets/templatetags/formset_tags.py rename to djaosdb/dynamic_formsets/templatetags/formset_tags.py index 357fd8d..88c610a 100644 --- a/djongo/dynamic_formsets/templatetags/formset_tags.py +++ b/djaosdb/dynamic_formsets/templatetags/formset_tags.py @@ -1,5 +1,5 @@ from django import template -from djongo.models.fields import ArrayFormField +from djaosdb.models.fields import ArrayFormField register = template.Library() diff --git a/djongo/exceptions.py b/djaosdb/exceptions.py similarity index 81% rename from djongo/exceptions.py rename to djaosdb/exceptions.py index 03af82f..46a8656 100644 --- a/djongo/exceptions.py +++ b/djaosdb/exceptions.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from typing import Sequence, Any -djongo_access_url = 'https://nesdis.github.io/djongo/sponsor/' +djaosdb_access_url = 'https://nesdis.github.io/djaosdb/sponsor/' _printed_features = set() @@ -38,7 +38,7 @@ class MigrationError(Exception): def print_warn(feature=None, message=None): if feature not in _printed_features: - message = ((message or f'This version of djongo does not support "{feature}" fully. ') - + f'Visit {djongo_access_url}') + message = ((message or f'This version of djaosdb does not support "{feature}" fully. ') + + f'Visit {djaosdb_access_url}') print(message) _printed_features.add(feature) \ No newline at end of file diff --git a/djongo/features.py b/djaosdb/features.py similarity index 87% rename from djongo/features.py rename to djaosdb/features.py index acfee1e..8ca8443 100644 --- a/djongo/features.py +++ b/djaosdb/features.py @@ -3,7 +3,7 @@ from django.db.backends.base.features import BaseDatabaseFeatures class DatabaseFeatures(BaseDatabaseFeatures): supports_transactions = False - # djongo doesn't seem to support this currently + # djaosdb doesn't seem to support this currently has_bulk_insert = True has_native_uuid_field = True supports_timezones = False diff --git a/djongo/introspection.py b/djaosdb/introspection.py similarity index 96% rename from djongo/introspection.py rename to djaosdb/introspection.py index 3921a4b..6bae9a9 100644 --- a/djongo/introspection.py +++ b/djaosdb/introspection.py @@ -30,9 +30,9 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): 'number': 'DecimalField', 'string': 'CharField', 'boolean': 'BooleanField', - 'object': 'djongo.models.DictField', - 'array': 'djongo.models.ListField', - 'oid': 'djongo.models.ObjectIdField', + 'object': 'djaosdb.models.DictField', + 'array': 'djaosdb.models.ListField', + 'oid': 'djaosdb.models.ObjectIdField', 'date': 'DateTimeField' } diff --git a/djongo/models/__init__.py b/djaosdb/models/__init__.py similarity index 100% rename from djongo/models/__init__.py rename to djaosdb/models/__init__.py diff --git a/djongo/models/fields.py b/djaosdb/models/fields.py similarity index 98% rename from djongo/models/fields.py rename to djaosdb/models/fields.py index 91907a8..275f28e 100644 --- a/djongo/models/fields.py +++ b/djaosdb/models/fields.py @@ -1,5 +1,5 @@ """ -The standard way of using djongo is to import models.py +The standard way of using djaosdb is to import models.py in place of Django's standard models module. Djongo Fields is where custom fields for working with @@ -20,7 +20,7 @@ import typing from bson import ObjectId from django import forms from django.core.exceptions import ValidationError -from django.db import connections as pymongo_connections +from django.db import connections as caosdb_connections from django.db import router, connections, transaction from django.db.models import ( Manager, Model, Field, AutoField, @@ -32,7 +32,7 @@ from django.utils.functional import cached_property from django.utils.html import format_html_join, format_html from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ -from djongo.exceptions import NotSupportedError, print_warn +from djaosdb.exceptions import NotSupportedError, print_warn django_major = int(version.get_version().split('.')[0]) @@ -60,7 +60,7 @@ class DjongoManager(Manager): This modified manager allows to issue Mongo functions by prefixing them with 'mongo_'. - This module allows methods to be passed directly to pymongo. + This module allows methods to be passed directly to caosdb. """ def __getattr__(self, name): @@ -72,7 +72,7 @@ class DjongoManager(Manager): @property def _client(self): - return (pymongo_connections[self.db] + return (caosdb_connections[self.db] .cursor() .db_conn[self.model._meta.db_table]) @@ -130,7 +130,7 @@ class ModelField(MongoField): if field.db_index: print_warn('Embedded field index') raise NotSupportedError( - f'This version of djongo does not support indexes on embedded fields' + f'This version of djaosdb does not support indexes on embedded fields' ) def _value_thru_fields(self, diff --git a/djaosdb/models/indexes.py b/djaosdb/models/indexes.py new file mode 100644 index 0000000..b7f4444 --- /dev/null +++ b/djaosdb/models/indexes.py @@ -0,0 +1 @@ +# This version of djaosdb does not support indexes diff --git a/djongo/models/json.py b/djaosdb/models/json.py similarity index 87% rename from djongo/models/json.py rename to djaosdb/models/json.py index aa2cdf3..2591d29 100644 --- a/djongo/models/json.py +++ b/djaosdb/models/json.py @@ -10,7 +10,7 @@ except ImportError: def __init__(self, *args, **kwargs): warnings.warn( '"jsoneditor" module not available, to enable json mode ' - 'please run: "pip install djongo[json]"', stacklevel=2) + 'please run: "pip install djaosdb[json]"', stacklevel=2) models.TextField.__init__(self, *args, **kwargs) diff --git a/djongo/operations.py b/djaosdb/operations.py similarity index 100% rename from djongo/operations.py rename to djaosdb/operations.py diff --git a/djongo/schema.py b/djaosdb/schema.py similarity index 100% rename from djongo/schema.py rename to djaosdb/schema.py diff --git a/djongo/sql2mongo/__init__.py b/djaosdb/sql2mongo/__init__.py similarity index 100% rename from djongo/sql2mongo/__init__.py rename to djaosdb/sql2mongo/__init__.py diff --git a/djaosdb/sql2mongo/aggregation.py b/djaosdb/sql2mongo/aggregation.py new file mode 100644 index 0000000..3907e10 --- /dev/null +++ b/djaosdb/sql2mongo/aggregation.py @@ -0,0 +1,4 @@ +from djaosdb.exceptions import NotSupportedError, print_warn + +print_warn('aggregation') + diff --git a/djaosdb/sql2mongo/constraints.py b/djaosdb/sql2mongo/constraints.py new file mode 100644 index 0000000..2d51b15 --- /dev/null +++ b/djaosdb/sql2mongo/constraints.py @@ -0,0 +1,5 @@ +from djaosdb.exceptions import NotSupportedError +from djaosdb import djaosdb_access_url + +print(f'This version of djaosdb does not support constraints. Visit {djaosdb_access_url}') +raise NotSupportedError('constraints') diff --git a/djongo/sql2mongo/converters.py b/djaosdb/sql2mongo/converters.py similarity index 100% rename from djongo/sql2mongo/converters.py rename to djaosdb/sql2mongo/converters.py diff --git a/djongo/sql2mongo/functions.py b/djaosdb/sql2mongo/functions.py similarity index 100% rename from djongo/sql2mongo/functions.py rename to djaosdb/sql2mongo/functions.py diff --git a/djongo/sql2mongo/operators.py b/djaosdb/sql2mongo/operators.py similarity index 100% rename from djongo/sql2mongo/operators.py rename to djaosdb/sql2mongo/operators.py diff --git a/djongo/sql2mongo/query.py b/djaosdb/sql2mongo/query.py similarity index 97% rename from djongo/sql2mongo/query.py rename to djaosdb/sql2mongo/query.py index 41a726c..a65dd61 100644 --- a/djongo/sql2mongo/query.py +++ b/djaosdb/sql2mongo/query.py @@ -7,12 +7,12 @@ import re from logging import getLogger from typing import Optional, Dict, List, Union as U, Sequence, Set from dataclasses import dataclass, field as dataclass_field -from pymongo import MongoClient -from pymongo import ReturnDocument -from pymongo.command_cursor import CommandCursor -from pymongo.cursor import Cursor as BasicCursor -from pymongo.database import Database -from pymongo.errors import OperationFailure, CollectionInvalid +from caosdb import MongoClient +from caosdb import ReturnDocument +from caosdb.command_cursor import CommandCursor +from caosdb.cursor import Cursor as BasicCursor +from caosdb.database import Database +from caosdb.errors import OperationFailure, CollectionInvalid from sqlparse import parse as sqlparse from sqlparse import tokens from sqlparse.sql import ( @@ -30,7 +30,7 @@ from .converters import ( SetConverter, AggOrderConverter, DistinctConverter, NestedInQueryConverter, GroupbyConverter, OffsetConverter, AggOffsetConverter, HavingConverter) -from djongo import base +from djaosdb import base logger = getLogger(__name__) @@ -810,21 +810,21 @@ class Query: raise except OperationFailure as e: - import djongo + import djaosdb exe = SQLDecodeError( f'FAILED SQL: {self._sql}\n' f'Params: {self._params}\n' f'Pymongo error: {e.details}\n' - f'Version: {djongo.__version__}' + f'Version: {djaosdb.__version__}' ) raise exe from e except Exception as e: - import djongo + import djaosdb exe = SQLDecodeError( f'FAILED SQL: {self._sql}\n' f'Params: {self._params}\n' - f'Version: {djongo.__version__}' + f'Version: {djaosdb.__version__}' ) raise exe from e @@ -859,27 +859,27 @@ class Query: raise except OperationFailure as e: - import djongo + import djaosdb exe = SQLDecodeError( err_sql=self._sql, params=self._params, - version=djongo.__version__ + version=djaosdb.__version__ ) raise exe from e except SQLDecodeError as e: - import djongo + import djaosdb e.err_sql = self._sql, e.params = self._params, - e.version = djongo.__version__ + e.version = djaosdb.__version__ raise e except Exception as e: - import djongo + import djaosdb exe = SQLDecodeError( err_sql=self._sql, params=self._params, - version=djongo.__version__ + version=djaosdb.__version__ ) raise exe from e diff --git a/djongo/sql2mongo/sql_tokens.py b/djaosdb/sql2mongo/sql_tokens.py similarity index 97% rename from djongo/sql2mongo/sql_tokens.py rename to djaosdb/sql2mongo/sql_tokens.py index f21e5e6..6dc99b3 100644 --- a/djongo/sql2mongo/sql_tokens.py +++ b/djaosdb/sql2mongo/sql_tokens.py @@ -1,15 +1,15 @@ import abc import re from typing import Union as U, Iterator, Optional as O -from pymongo import ASCENDING, DESCENDING +from caosdb import ASCENDING, DESCENDING from sqlparse import tokens, parse as sqlparse from sqlparse.sql import Token, Identifier, Function, Comparison, Parenthesis, IdentifierList, Statement from . import query as query_module from ..exceptions import SQLDecodeError, NotSupportedError all_token_types = U['SQLConstIdentifier', - 'djongo.sql2mongo.functions.CountFunc', - 'djongo.sql2mongo.functions.SimpleFunc', + 'djaosdb.sql2mongo.functions.CountFunc', + 'djaosdb.sql2mongo.functions.SimpleFunc', 'SQLIdentifier', 'SQLComparison', 'SQLPlaceholder'] @@ -361,7 +361,7 @@ class SQLColumnDef: @classmethod def def_str2col_def(cls, def_str: str): if not cls.supported_data_types: - from djongo.base import DatabaseWrapper + from djaosdb.base import DatabaseWrapper cls.supported_data_types = set(DatabaseWrapper.data_types.values()) name, other = def_str[1:].split('"', 1) @@ -378,7 +378,7 @@ class SQLColumnDef: @classmethod def statement2col_defs(cls, token: Token): - from djongo.base import DatabaseWrapper + from djaosdb.base import DatabaseWrapper supported_data_types = set(DatabaseWrapper.data_types.values()) defs = token.value.strip('()').split(',') diff --git a/djongo/sql2mongo/validation.py b/djaosdb/sql2mongo/validation.py similarity index 67% rename from djongo/sql2mongo/validation.py rename to djaosdb/sql2mongo/validation.py index d5eab72..a4be6b2 100644 --- a/djongo/sql2mongo/validation.py +++ b/djaosdb/sql2mongo/validation.py @@ -1,4 +1,4 @@ -from djongo.exceptions import NotSupportedError, print_warn +from djaosdb.exceptions import NotSupportedError, print_warn print_warn('validation') diff --git a/djongo/storage.py b/djaosdb/storage.py similarity index 100% rename from djongo/storage.py rename to djaosdb/storage.py diff --git a/djaosdb/transaction.py b/djaosdb/transaction.py new file mode 100644 index 0000000..c9ba630 --- /dev/null +++ b/djaosdb/transaction.py @@ -0,0 +1,5 @@ +from djaosdb.exceptions import NotSupportedError +from djaosdb import djaosdb_access_url + +print(f'This version of djaosdb does not support transactions. Visit {djaosdb_access_url}') +raise NotSupportedError('transactions') diff --git a/djongo/models/indexes.py b/djongo/models/indexes.py deleted file mode 100644 index dfc5664..0000000 --- a/djongo/models/indexes.py +++ /dev/null @@ -1 +0,0 @@ -# This version of djongo does not support indexes diff --git a/djongo/sql2mongo/aggregation.py b/djongo/sql2mongo/aggregation.py deleted file mode 100644 index 677d6be..0000000 --- a/djongo/sql2mongo/aggregation.py +++ /dev/null @@ -1,4 +0,0 @@ -from djongo.exceptions import NotSupportedError, print_warn - -print_warn('aggregation') - diff --git a/djongo/sql2mongo/constraints.py b/djongo/sql2mongo/constraints.py deleted file mode 100644 index 236890a..0000000 --- a/djongo/sql2mongo/constraints.py +++ /dev/null @@ -1,5 +0,0 @@ -from djongo.exceptions import NotSupportedError -from djongo import djongo_access_url - -print(f'This version of djongo does not support constraints. Visit {djongo_access_url}') -raise NotSupportedError('constraints') diff --git a/djongo/transaction.py b/djongo/transaction.py deleted file mode 100644 index 0ce03de..0000000 --- a/djongo/transaction.py +++ /dev/null @@ -1,5 +0,0 @@ -from djongo.exceptions import NotSupportedError -from djongo import djongo_access_url - -print(f'This version of djongo does not support transactions. Visit {djongo_access_url}') -raise NotSupportedError('transactions') diff --git a/docs/_config.yml b/docs/_config.yml index 0904654..d86c5a4 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -10,11 +10,11 @@ title_separator : "-" name : "Nesdis" description : "Djongo is specifically meant to be used with the original Django ORM and MongoDB. Using the Django admin app one can directly add and modify documents stored in MongoDB. Other contrib modules such as Auth and Sessions work without any changes" url : "https://nesdis.github.io" -baseurl : "/djongo" -repository : "nesdis/djongo" +baseurl : "/djaosdb" +repository : "nesdis/djaosdb" teaser : # path of fallback teaser image, e.g. "/assets/images/500x300.png" # breadcrumbs : false # true, false (default) -logo : "/assets/images/djongo-logo.png" +logo : "/assets/images/djaosdb-logo.png" words_per_minute : 200 comments: provider : # false (default), "disqus", "discourse", "facebook", "google-plus", "staticman", "staticman_v2" "custom" diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index fe2d41f..8e118a8 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -7,7 +7,7 @@ main: - title: "Discuss" url: /discuss/ - title: "Source" - url: https://github.com/nesdis/djongo/ + url: https://github.com/nesdis/djaosdb/ docs: - title: "Usage" @@ -15,7 +15,7 @@ docs: - title: "Get Started" url: /get-started/ - title: "Djongo Deep Dive" - url: /djongo-deep-dive/ + url: /djaosdb-deep-dive/ - title: "Djongo Fields" children: - title: "Embedded Field" @@ -28,29 +28,29 @@ docs: url: /using-django-with-other-fields/ - title: "DjongoNxt" -# url: /djongonxt/ +# url: /djaosdbnxt/ children: - title: "Indexes" - url: /djongonxt-indexes/ + url: /djaosdbnxt-indexes/ - title: "Model Query" - url: /djongonxt-model-query/ + url: /djaosdbnxt-model-query/ - title: "Model Creation" - url: /djongonxt-model-creation/ + url: /djaosdbnxt-model-creation/ - title: "Model Update" - url: /djongonxt-model-update/ + url: /djaosdbnxt-model-update/ - title: "Database Transactions" - url: /djongonxt-database-transactions/ + url: /djaosdbnxt-database-transactions/ # - title: "Aggregation" -# url: /djongonxt-aggregation/ +# url: /djaosdbnxt-aggregation/ - title: "Contact" - url: /djongonxt-more-info/ + url: /djaosdbnxt-more-info/ - title: "Get DjongoNxt" url: /sponsor/ - title: "Side stuff" children: - title: "Djongo vs Others" - url: /djongo-comparison/ + url: /djaosdb-comparison/ - title: "Djongo Design" url: /django-mongodb-connector-design-document/ # - title: "Roadmap" @@ -58,4 +58,4 @@ docs: # - title: "Donate" # url: /donate/ -# thumbnail: /djongo/assets/images/heart.png +# thumbnail: /djaosdb/assets/images/heart.png diff --git a/docs/_data/navigation2.yml b/docs/_data/navigation2.yml index 8919817..4ebf892 100644 --- a/docs/_data/navigation2.yml +++ b/docs/_data/navigation2.yml @@ -3,10 +3,10 @@ main: - title: "Get Started" url: /get-started/ - title: "Get The Source" - url: https://github.com/nesdis/djongo/ + url: https://github.com/nesdis/djaosdb/ - title: "Donate" url: /donate/ - thumbnail: /djongo/assets/images/heart.png + thumbnail: /djaosdb/assets/images/heart.png docs: - title: "Get started" diff --git a/docs/_includes/links b/docs/_includes/links index b21e418..bca0fbb 100644 --- a/docs/_includes/links +++ b/docs/_includes/links @@ -1,2 +1,2 @@ -[sponsor_page]: https://nesdis.github.io/djongo/sponsor/ +[sponsor_page]: https://nesdis.github.io/djaosdb/sponsor/ diff --git a/docs/_includes/pizza.html b/docs/_includes/pizza.html index 6d31baa..9bf8206 100644 --- a/docs/_includes/pizza.html +++ b/docs/_includes/pizza.html @@ -1,6 +1,6 @@ {% if page.pizza %} <aside class="sidebar__right" style="position: sticky; top: 2em; float: right"> <header><h4 class="nav__title"><i class="fas fa-{{ page.toc_icon | default: 'file-alt' }}"></i> Buy ME A Pizza</h4></header> - <a href="https://www.patreon.com/posts/buy-me-pizza-26095081"><img src="/djongo/assets/images/pizza.jpg"></a> + <a href="https://www.patreon.com/posts/buy-me-pizza-26095081"><img src="/djaosdb/assets/images/pizza.jpg"></a> </aside> {% endif %} \ No newline at end of file diff --git a/docs/_includes/vendors/stripe.html b/docs/_includes/vendors/stripe.html index 8637d8b..c5b9fc3 100644 --- a/docs/_includes/vendors/stripe.html +++ b/docs/_includes/vendors/stripe.html @@ -21,7 +21,7 @@ .redirectToCheckout({ lineItems: [{ price: priceId, quantity: 1 }], successUrl: - DOMAIN + "/djongo?session_id={CHECKOUT_SESSION_ID}", + DOMAIN + "/djaosdb?session_id={CHECKOUT_SESSION_ID}", cancelUrl: DOMAIN + "/sponsor", mode: 'subscription', }) diff --git a/docs/assets/images/banner.svg b/docs/assets/images/banner.svg index 320322e..b5b3a6a 100644 --- a/docs/assets/images/banner.svg +++ b/docs/assets/images/banner.svg @@ -16,7 +16,7 @@ version="1.1" inkscape:version="0.91 r13725" sodipodi:docname="banner.svg" - inkscape:export-filename="C:\Users\27989\twsent\djongo\bitbucket\djongo\docs\images\banner.png" + inkscape:export-filename="C:\Users\27989\twsent\djaosdb\bitbucket\djaosdb\docs\images\banner.png" inkscape:export-xdpi="190.05125" inkscape:export-ydpi="190.05125"> <defs @@ -392,7 +392,7 @@ x="1598.8973" y="695.34308" style="font-size:24.66662025px" - id="tspan4416-0">SQL to pymongo</tspan></tspan></text> + id="tspan4416-0">SQL to caosdb</tspan></tspan></text> <rect style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.28888273;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" id="rect4136-2-1-0-2-5" diff --git a/docs/assets/images/layers.svg b/docs/assets/images/layers.svg index ede26c5..22fc2b3 100644 --- a/docs/assets/images/layers.svg +++ b/docs/assets/images/layers.svg @@ -16,7 +16,7 @@ version="1.1" inkscape:version="0.91 r13725" sodipodi:docname="layers.svg" - inkscape:export-filename="C:\Users\27989\twsent\djongo\bitbucket\djongo\docs\images\layers.png" + inkscape:export-filename="C:\Users\27989\twsent\djaosdb\bitbucket\djaosdb\docs\images\layers.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> <defs diff --git a/docs/assets/images/orm2odm.svg b/docs/assets/images/orm2odm.svg index 6d71394..d4797aa 100644 --- a/docs/assets/images/orm2odm.svg +++ b/docs/assets/images/orm2odm.svg @@ -16,7 +16,7 @@ version="1.1" inkscape:version="0.91 r13725" sodipodi:docname="orm2odm.svg" - inkscape:export-filename="C:\Users\27989\twsent\djongo\bitbucket\djongo\docs\images\orm2odm.png" + inkscape:export-filename="C:\Users\27989\twsent\djaosdb\bitbucket\djaosdb\docs\images\orm2odm.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> <defs diff --git a/docs/assets/images/sql2mongodb.svg b/docs/assets/images/sql2mongodb.svg index 8870580..573bd9d 100644 --- a/docs/assets/images/sql2mongodb.svg +++ b/docs/assets/images/sql2mongodb.svg @@ -16,7 +16,7 @@ version="1.1" inkscape:version="0.91 r13725" sodipodi:docname="sql2mongodb.svg" - inkscape:export-filename="C:\Users\27989\twsent\djongo\bitbucket\djongo\docs\images\sql2mongodb.png" + inkscape:export-filename="C:\Users\27989\twsent\djaosdb\bitbucket\djaosdb\docs\images\sql2mongodb.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> <defs @@ -328,7 +328,7 @@ x="854.16327" y="537.30371" style="font-size:30px" - id="tspan4416-0">SQL to pymongo</tspan></tspan></text> + id="tspan4416-0">SQL to caosdb</tspan></tspan></text> <rect style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#f0f0f0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" id="rect4136-2-1-0-2" diff --git a/docs/docs/Discuss.md b/docs/docs/Discuss.md index 7ff9fa1..89e142f 100644 --- a/docs/docs/Discuss.md +++ b/docs/docs/Discuss.md @@ -24,7 +24,7 @@ Djongo forum is where you can watch for: <script type="text/javascript"> document.getElementById('forum_embed').src = - 'https://groups.google.com/forum/embed/?place=forum/djongo' + 'https://groups.google.com/forum/embed/?place=forum/djaosdb' + '&showsearch=true&showpopout=true&showtabs=false' + '&parenturl=' + encodeURIComponent(window.location.href); </script> \ No newline at end of file diff --git a/docs/docs/different-ways-to-integrate-django-with-mongodb.md b/docs/docs/different-ways-to-integrate-django-with-mongodb.md index 3e3c3e6..07174df 100644 --- a/docs/docs/different-ways-to-integrate-django-with-mongodb.md +++ b/docs/docs/different-ways-to-integrate-django-with-mongodb.md @@ -1,10 +1,10 @@ --- title: Djongo vs Others -permalink: /djongo-comparison/ +permalink: /djaosdb-comparison/ description: This page describes how to integrate MongoDB with Django with focus on Djongo. It describes the Django ORM internal implementation that is not covered by the Django documentation. --- -This page describes how to integrate MongoDB with Django with focus on Djongo. It describes the Django ORM internal implementation that is not covered by the [Django documentation](https://docs.djangoproject.com/en/dev/). If you have not yet checked out the [introduction to Djongo](https://nesdis.github.io/djongo/), be sure to do so first! +This page describes how to integrate MongoDB with Django with focus on Djongo. It describes the Django ORM internal implementation that is not covered by the [Django documentation](https://docs.djangoproject.com/en/dev/). If you have not yet checked out the [introduction to Djongo](https://nesdis.github.io/djaosdb/), be sure to do so first! There are different ways to integrate MongoDB with Django, each with positives and negatives. Insights into the Django ORM design will help understand ways to integrate MongoDB and Django. @@ -13,7 +13,7 @@ There are different ways to integrate MongoDB with Django, each with positives a The Django ORM can be broadly thought of as multiple Abstraction Layers stacked on top of each other. <div style="max-width: 150px; margin-left: auto; margin-right: auto"> - <img src="/djongo/assets/images/layers.svg" alt="Abstraction Layers"> + <img src="/djaosdb/assets/images/layers.svg" alt="Abstraction Layers"> </div> @@ -41,7 +41,7 @@ The Database only accepts SQL query string specific to its type. Object Document Mapping (ODM) is the Object Relational Mapping (ORM) for non-relational document oriented databases (like MongoDB). In an ODM, python objects (or group of them) are stored as documents instead of tables. Implementing an ODM for Django would entail rewriting several Django modules. <div style="max-width: 400px; margin-left: auto; margin-right: auto"> - <img src="/djongo/assets/images/orm2odm.svg" alt="Abstraction Layers"> + <img src="/djaosdb/assets/images/orm2odm.svg" alt="Abstraction Layers"> </div> ### Django-nonrel @@ -50,10 +50,10 @@ Object Document Mapping (ODM) is the Object Relational Mapping (ORM) for non-rel ## Django SQL to MongoDB transpiler -A different approach is to translate Django SQL query syntax into pymongo commands. +A different approach is to translate Django SQL query syntax into caosdb commands. <div style="max-width: 400px; margin-left: auto; margin-right: auto"> - <img src="/djongo/assets/images/sql2mongodb.svg" alt="Abstraction Layers"> + <img src="/djaosdb/assets/images/sql2mongodb.svg" alt="Abstraction Layers"> </div> This has several advantages @@ -84,6 +84,6 @@ Relations between objects and subsequent joins can be done in non relational dat Unstructured data is a super set of structured data. Specifying the data structure to MongoDB will only be ignored by it. -More details on [implementing Django MongoDB connector](/djongo/django-mongodb-connector-design-document/) can be found in the design document. +More details on [implementing Django MongoDB connector](/djaosdb/django-mongodb-connector-design-document/) can be found in the design document. diff --git a/docs/docs/django-mongodb-connector-design-document.md b/docs/docs/django-mongodb-connector-design-document.md index db9585c..029a7e7 100644 --- a/docs/docs/django-mongodb-connector-design-document.md +++ b/docs/docs/django-mongodb-connector-design-document.md @@ -5,7 +5,7 @@ permalink: /django-mongodb-connector-design-document/ ## SQL to MongoDB query mapping. -SQL query | pymongo API +SQL query | caosdb API ----------|------------ SELECT | find(projection=) WHERE | find(filter=) diff --git a/docs/docs/djongo-deep-dive.md b/docs/docs/djongo-deep-dive.md index e01c781..f321875 100644 --- a/docs/docs/djongo-deep-dive.md +++ b/docs/docs/djongo-deep-dive.md @@ -1,6 +1,6 @@ --- title: Django and MongoDB connector -permalink: /djongo-deep-dive/ +permalink: /djaosdb-deep-dive/ --- {{ page.notice.sponsor }} @@ -11,20 +11,20 @@ The `settings.py` supports (but is not limited to) the following options: Attribute | Value | Description ---------|------|------------- -ENGINE | djongo | The MongoDB connection engine for interfacing with Django. +ENGINE | djaosdb | The MongoDB connection engine for interfacing with Django. ENFORCE_SCHEMA | True | Ensures that the model schema and database schema are exactly the same. Raises `Migration Error` in case of discrepancy. ENFORCE_SCHEMA | False | (Default) Implicitly creates collections. Returns missing fields as `None` instead of raising an exception. NAME | your-db-name | Specify your database name. This field cannot be left empty. -LOGGING | dict | A [dictConfig](https://docs.python.org/3.6/library/logging.config.html) for the type of logging to run on djongo. -CLIENT | dict | A set of key-value pairs that will be passed directly to [`MongoClient`]((http://api.mongodb.com/python/current/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient)) as kwargs while creating a new client connection. +LOGGING | dict | A [dictConfig](https://docs.python.org/3.6/library/logging.config.html) for the type of logging to run on djaosdb. +CLIENT | dict | A set of key-value pairs that will be passed directly to [`MongoClient`]((http://api.mongodb.com/python/current/api/caosdb/mongo_client.html#caosdb.mongo_client.MongoClient)) as kwargs while creating a new client connection. -All options except `ENGINE` and `ENFORCE_SCHEMA` are the same those listed in the [pymongo documentation](http://api.mongodb.com/python/current/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient). +All options except `ENGINE` and `ENFORCE_SCHEMA` are the same those listed in the [caosdb documentation](http://api.mongodb.com/python/current/api/caosdb/mongo_client.html#caosdb.mongo_client.MongoClient). ```python DATABASES = { 'default': { - 'ENGINE': 'djongo', + 'ENGINE': 'djaosdb', 'NAME': 'your-db-name', 'ENFORCE_SCHEMA': False, 'CLIENT': { @@ -38,7 +38,7 @@ All options except `ENGINE` and `ENFORCE_SCHEMA` are the same those listed in th 'LOGGING': { 'version': 1, 'loggers': { - 'djongo': { + 'djaosdb': { 'level': 'DEBUG', 'propagate': False, } @@ -77,10 +77,10 @@ When connecting to Djongo you can set `ENFORCE_SCHEMA: True`. In this case, a `M ## Use Django Admin to add documents -The Django Admin interface can be used to work with MongoDB. Additionally, several MongoDB specific features are supported using [EmbeddedField](/djongo/using-django-with-mongodb-data-fields/), [ArrayField](/djongo/using-django-with-mongodb-array-field/) and other fields. Let’s say you want to create a blogging platform using Django with MongoDB as your backend. In your Blog `app/models.py` file define the `Blog` model: +The Django Admin interface can be used to work with MongoDB. Additionally, several MongoDB specific features are supported using [EmbeddedField](/djaosdb/using-django-with-mongodb-data-fields/), [ArrayField](/djaosdb/using-django-with-mongodb-array-field/) and other fields. Let’s say you want to create a blogging platform using Django with MongoDB as your backend. In your Blog `app/models.py` file define the `Blog` model: ```python -from djongo import models +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -113,7 +113,7 @@ admin.site.register(Entry) That’s it you are set! Fire up Django Admin on localhost:8000/admin/ and this is what you get: - + ### Querying Embedded fields @@ -124,11 +124,11 @@ In the above example, to query all Entries with Blogs which have names that star entries = Entry.objects.filter(blog__startswith={'name': 'Beatles'}) ``` -Refer to [Using Django with MongoDB data fields](/djongo/using-django-with-mongodb-data-fields/) for more details. +Refer to [Using Django with MongoDB data fields](/djaosdb/using-django-with-mongodb-data-fields/) for more details. ## Djongo Manager -Djongo Manager extends the functionality of the usual [Django Manager](https://docs.djangoproject.com/en/dev/topics/db/managers/). It gives direct access to the pymongo collection API. To use this manager define your manager as `DjongoManager` in the model. +Djongo Manager extends the functionality of the usual [Django Manager](https://docs.djangoproject.com/en/dev/topics/db/managers/). It gives direct access to the caosdb collection API. To use this manager define your manager as `DjongoManager` in the model. ```python class Entry(models.Model): @@ -167,7 +167,7 @@ class EntryView(DetailView): ``` -You can directly **access any** [pymongo command](https://api.mongodb.com/python/current/) by prefixing `mongo_` to the command name. +You can directly **access any** [caosdb command](https://api.mongodb.com/python/current/) by prefixing `mongo_` to the command name. {: .notice} For example, to perform `aggregate` on the BlogPage collection (BlogPage is stored as a table in SQL or a collection in MongoDB) the function name becomes `mongo_aggregate`. To directly insert a document (instead of `.save()` a model) use `mongo_insert_one()` @@ -186,20 +186,20 @@ In your model define your field as `FileField` or `ImageField` as usual: avatar = models.ImageField(storage=grid_fs_storage, upload_to='') ``` -Refer to [Using GridFSStorage](/djongo/using-django-with-mongodb-gridfs/) for more details. +Refer to [Using GridFSStorage](/djaosdb/using-django-with-mongodb-gridfs/) for more details. ## Migrating an existing Django app to MongoDB -When migrating an existing Django app to MongoDB, it is recommended to start a new database on MongoDB. For example, use `myapp-djongo-db` in your `settings.py` file. +When migrating an existing Django app to MongoDB, it is recommended to start a new database on MongoDB. For example, use `myapp-djaosdb-db` in your `settings.py` file. 1. Into `settings.py` file of your project, add: ```python DATABASES = { 'default': { - 'ENGINE': 'djongo', - 'NAME': 'myapp-djongo-db', + 'ENGINE': 'djaosdb', + 'NAME': 'myapp-djaosdb-db', } } ``` diff --git a/docs/docs/djongonxt/creating-django-capped-models-using-mongodb.md b/docs/docs/djongonxt/creating-django-capped-models-using-mongodb.md index 667b225..8a0ab23 100644 --- a/docs/docs/djongonxt/creating-django-capped-models-using-mongodb.md +++ b/docs/docs/djongonxt/creating-django-capped-models-using-mongodb.md @@ -40,10 +40,10 @@ class Entry(models.Model): As most SQL DBs do not support capped tables, Django lacks a way to define such tables during a migration. Djongo comes with it is own version of `manage.py` to make this happen. Switch to the root directory of your app and from the command line run: ``` -python -m djongo.manage migrate +python -m djaosdb.manage migrate ``` -This will result in all Models having `capped == True` to being recreated as Capped collections. Use this command only if such a collection doesn't already exists or is empty, as `djongo.manage` will drop all collections marked as capped in the model but are not capped in the DB and create a new empty capped collection. +This will result in all Models having `capped == True` to being recreated as Capped collections. Use this command only if such a collection doesn't already exists or is empty, as `djaosdb.manage` will drop all collections marked as capped in the model but are not capped in the DB and create a new empty capped collection. {{page.notice.not_ready}} diff --git a/docs/docs/djongonxt/djongonxt-aggregation.md b/docs/docs/djongonxt/djongonxt-aggregation.md index 7332d39..7c4c5cf 100644 --- a/docs/docs/djongonxt/djongonxt-aggregation.md +++ b/docs/docs/djongonxt/djongonxt-aggregation.md @@ -1,6 +1,6 @@ --- title: DjongoNxt Aggregation -permalink: /djongonxt-aggregation/ +permalink: /djaosdbnxt-aggregation/ --- ## Using Aggregation Operators diff --git a/docs/docs/djongonxt/djongonxt-database-transactions.md b/docs/docs/djongonxt/djongonxt-database-transactions.md index 56b2f4e..e64d8e4 100644 --- a/docs/docs/djongonxt/djongonxt-database-transactions.md +++ b/docs/docs/djongonxt/djongonxt-database-transactions.md @@ -1,6 +1,6 @@ --- title: DjongoNxt Database Transactions -permalink: /djongonxt-database-transactions/ +permalink: /djaosdbnxt-database-transactions/ --- @@ -11,7 +11,7 @@ Djongo integrates with MongoDB Transactions API to support multi document atomic ### Example ```python -from djongo import transaction +from djaosdb import transaction def viewfunc(request): stuff() @@ -21,7 +21,7 @@ def viewfunc(request): more_stuff() ``` -This produces the following pymongo commands: +This produces the following caosdb commands: ```python session = cli.start_session() diff --git a/docs/docs/djongonxt/djongonxt-indexes.md b/docs/docs/djongonxt/djongonxt-indexes.md index b87ea7d..c4c2a36 100644 --- a/docs/docs/djongonxt/djongonxt-indexes.md +++ b/docs/docs/djongonxt/djongonxt-indexes.md @@ -1,6 +1,6 @@ --- title: DjongoNxt Indexes -permalink: /djongonxt-indexes/ +permalink: /djaosdbnxt-indexes/ --- ## Compound Index @@ -25,13 +25,13 @@ Argument | Type | Description `background` | `boolean` | Create the index in the background. `partialFilterExpression` | `Q` | Used to create [partial indexes](https://docs.mongodb.com/manual/core/index-partial/). Similar to Django [Index condition](https://docs.djangoproject.com/en/dev/ref/models/indexes/#condition). Takes an instance of [Q](https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.Q) to build the filter expression. `sparse` | `boolean` | Used to create [sparse indexes](https://docs.mongodb.com/manual/core/index-sparse/) -`collation` | `Collation` | Used to specify the [collation](https://docs.mongodb.com/manual/reference/collation/). Takes an instance of [collation](https://api.mongodb.com/python/current/api/pymongo/collation.html) +`collation` | `Collation` | Used to specify the [collation](https://docs.mongodb.com/manual/reference/collation/). Takes an instance of [collation](https://api.mongodb.com/python/current/api/caosdb/collation.html) ### Example ```python -from djongo.models.indexes import CompoundIndex -from djongo import models +from djaosdb.models.indexes import CompoundIndex +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -43,7 +43,7 @@ class Blog(models.Model): ] ``` -Generates the pymongo command: +Generates the caosdb command: ```python db.blog.create_index( { 'name': 1, 'tagline': -1 } ) @@ -66,8 +66,8 @@ class TextIndex( ### Example ```python -from djongo.models.indexes import TextIndex -from djongo import models +from djaosdb.models.indexes import TextIndex +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -79,7 +79,7 @@ class Blog(models.Model): ] ``` -Generates the pymongo command: +Generates the caosdb command: ```python db.blog.create_index( { 'name': 'text', 'tagline': 'text' } ) @@ -101,8 +101,8 @@ class WildcardIndex( ### Example ```python -from djongo.models.indexes import WildcardIndex -from djongo import models +from djaosdb.models.indexes import WildcardIndex +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -120,7 +120,7 @@ class Entry(models.Model): WildcardIndex(fields=['blog']) ] ``` -Generates the pymongo command: +Generates the caosdb command: ```python db.entry.create_index( { 'blog.$**': 1 } ) @@ -142,8 +142,8 @@ class TwoDSphereIndex( ### Example ```python -from djongo.models.indexes import TwoDSphereIndex -from djongo import models +from djaosdb.models.indexes import TwoDSphereIndex +from djaosdb import models class Location(models.Model): type = models.CharField(max_length=100) @@ -161,7 +161,7 @@ class Entry(models.Model): TwoDSphereIndex(fields=['loc']) ] ``` -Generates the pymongo command: +Generates the caosdb command: ```python db.entry.create_index( { 'loc' : '2dsphere' } ) @@ -181,8 +181,8 @@ class HashedIndex( ### Example ```python -from djongo.models.indexes import HashedIndex -from djongo import models +from djaosdb.models.indexes import HashedIndex +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -194,7 +194,7 @@ class Blog(models.Model): ] ``` -Generates the pymongo command: +Generates the caosdb command: ```python db.blog.create_index( { 'name': 'hashed' } ) @@ -215,8 +215,8 @@ class TTLIndex( ### Example ```python -from djongo.models.indexes import TTLIndex -from djongo import models +from djaosdb.models.indexes import TTLIndex +from djaosdb import models class Blog(models.Model): pub_date = models.DateTimeField() @@ -227,7 +227,7 @@ class Blog(models.Model): ] ``` -Generates the pymongo command: +Generates the caosdb command: ```python db.blog.create_index( { 'pub_date': 1 }, expireAfterSeconds=3600 ) diff --git a/docs/docs/djongonxt/djongonxt-model-creation.md b/docs/docs/djongonxt/djongonxt-model-creation.md index 6fe4afa..810d09e 100644 --- a/docs/docs/djongonxt/djongonxt-model-creation.md +++ b/docs/docs/djongonxt/djongonxt-model-creation.md @@ -1,19 +1,19 @@ --- title: DjongoNxt Model Creation -permalink: /djongonxt-model-creation/ +permalink: /djaosdbnxt-model-creation/ --- ## Schema Validation and CheckConstraint -Djongo automatically generates schema validation JSON documents for your models providing an extra layer of data validation and checking from within MongoDB. By creating [check constraints](https://docs.djangoproject.com/en/3.0/ref/models/constraints/#checkconstraint) in the Model Meta definition, djongo automatically interprets it to generate a [JSON Schema](https://docs.mongodb.com/manual/core/schema-validation/#json-schema) and a [query expression](https://docs.mongodb.com/manual/core/schema-validation/#other-query-expressions) +Djongo automatically generates schema validation JSON documents for your models providing an extra layer of data validation and checking from within MongoDB. By creating [check constraints](https://docs.djangoproject.com/en/3.0/ref/models/constraints/#checkconstraint) in the Model Meta definition, djaosdb automatically interprets it to generate a [JSON Schema](https://docs.mongodb.com/manual/core/schema-validation/#json-schema) and a [query expression](https://docs.mongodb.com/manual/core/schema-validation/#other-query-expressions) ### Example ```python -from djongo.models import CheckConstraint, Q -from djongo import models -from pymongo.read_concern import ReadConcern +from djaosdb.models import CheckConstraint, Q +from djaosdb import models +from caosdb.read_concern import ReadConcern class Blog(models.Model): name = models.CharField(max_length=100) @@ -27,7 +27,7 @@ class Blog(models.Model): ``` ## CollectionConstraint and Capped Collections -Djongo introduces a new `CollectionConstraint`. Use this to specify MongoDB specific collection properties that are usually used when calling [create_collection](https://api.mongodb.com/python/current/api/pymongo/database.html#pymongo.database.Database.create_collection) +Djongo introduces a new `CollectionConstraint`. Use this to specify MongoDB specific collection properties that are usually used when calling [create_collection](https://api.mongodb.com/python/current/api/caosdb/database.html#caosdb.database.Database.create_collection) ```python class CollectionConstraint(**kwargs) @@ -40,14 +40,14 @@ All arguments passed to `create_collection` with the exception of `name` can be Argument | Type | Description ---------|------|------------- `codec_options` | `CodecOptions` | An instance of [CodecOptions](https://api.mongodb.com/python/current/api/bson/codec_options.html#bson.codec_options.CodecOptions). -`collation` | `Collation` | Takes an instance of [Collation](https://api.mongodb.com/python/current/api/pymongo/collation.html) +`collation` | `Collation` | Takes an instance of [Collation](https://api.mongodb.com/python/current/api/caosdb/collation.html) ### Example ```python -from djongo.models import CollectionConstraint -from djongo import models -from pymongo.read_concern import ReadConcern +from djaosdb.models import CollectionConstraint +from djaosdb import models +from caosdb.read_concern import ReadConcern class Blog(models.Model): name = models.CharField(max_length=100) diff --git a/docs/docs/djongonxt/djongonxt-model-query.md b/docs/docs/djongonxt/djongonxt-model-query.md index 0ad3dcc..32c8099 100644 --- a/docs/docs/djongonxt/djongonxt-model-query.md +++ b/docs/docs/djongonxt/djongonxt-model-query.md @@ -1,6 +1,6 @@ --- title: DjongoNxt Model Query -permalink: /djongonxt-model-query/ +permalink: /djaosdbnxt-model-query/ --- ## Text Search @@ -10,8 +10,8 @@ Djongo lets you run [MongoDB text search](https://docs.mongodb.com/manual/core/t ### Example ```python -from djongo.models.indexes import TextIndex -from djongo import models +from djaosdb.models.indexes import TextIndex +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -26,7 +26,7 @@ class Blog(models.Model): ```python Blog.objects.filter(name__text_search='Paul Lennon') ``` -This will generate the pymongo command: +This will generate the caosdb command: ```python db.blog.find( { '$text': { '$search': "Paul Lennon" } } ) @@ -50,8 +50,8 @@ class Near( ### Example ```python -from djongo.models.indexes import TwoDSphereIndex -from djongo import models +from djaosdb.models.indexes import TwoDSphereIndex +from djaosdb import models class Location(models.Model): type = models.CharField(max_length=100) @@ -71,7 +71,7 @@ class Entry(models.Model): ``` ```python -from djongo.models import Near +from djaosdb.models import Near search_region = Near( type='point', @@ -83,7 +83,7 @@ search_region = Near( Entry.objects.filter(loc__near=search_region) ``` -This generates the following pymongo search query: +This generates the following caosdb search query: ```python db.entry.find({ @@ -100,14 +100,14 @@ db.entry.find({ ## Specifying Query Options -Djongo lets you specify the configuration of the find command into your [QuerySets](https://docs.djangoproject.com/en/dev/ref/models/querysets/). Call the `configure` method on a QuerySet to configure the find query. All options supported by [aggregate](https://api.mongodb.com/python/current/api/pymongo/collection.html#pymongo.collection.Collection.aggregate) or [find](https://api.mongodb.com/python/current/api/pymongo/collection.html#pymongo.collection.Collection.find) can be included as `kwargs`. Example of valid arguments: +Djongo lets you specify the configuration of the find command into your [QuerySets](https://docs.djangoproject.com/en/dev/ref/models/querysets/). Call the `configure` method on a QuerySet to configure the find query. All options supported by [aggregate](https://api.mongodb.com/python/current/api/caosdb/collection.html#caosdb.collection.Collection.aggregate) or [find](https://api.mongodb.com/python/current/api/caosdb/collection.html#caosdb.collection.Collection.find) can be included as `kwargs`. Example of valid arguments: ### Arguments Argument | Type | Description ---------|------|------------- `allowDiskUse` | `boolean` | Enables writing to temporary files -`collation` | `Collation` | Used to specify the [collation](https://docs.mongodb.com/manual/reference/collation/). Takes an instance of [Collation](https://api.mongodb.com/python/current/api/pymongo/collation.html) +`collation` | `Collation` | Used to specify the [collation](https://docs.mongodb.com/manual/reference/collation/). Takes an instance of [Collation](https://api.mongodb.com/python/current/api/caosdb/collation.html) ### Example @@ -115,14 +115,14 @@ Argument | Type | Description ```python Blog.objects.filter(name='John Lennon').configure(hint=['-tagline']) ``` -This generates the following pymongo find query: +This generates the following caosdb find query: ```python -db.blog.find({'name': 'John Lennon'}, hint=[('tagline', pymongo.DESCENDING)]) +db.blog.find({'name': 'John Lennon'}, hint=[('tagline', caosdb.DESCENDING)]) ``` ## Tailable Cursors -Tailable cursors are used to retrieve data from [capped collections](https://docs.mongodb.com/manual/core/capped-collections/). The querySet first has to be configured using `configure` to use a tailable cursor in the pymongo find command. Results of the querySet can only be accessed by generating an iterator by calling the [QuerySet iterator](https://docs.djangoproject.com/en/3.0/ref/models/querysets/#iterator) +Tailable cursors are used to retrieve data from [capped collections](https://docs.mongodb.com/manual/core/capped-collections/). The querySet first has to be configured using `configure` to use a tailable cursor in the caosdb find command. Results of the querySet can only be accessed by generating an iterator by calling the [QuerySet iterator](https://docs.djangoproject.com/en/3.0/ref/models/querysets/#iterator) ### Example diff --git a/docs/docs/djongonxt/djongonxt-model-update.md b/docs/docs/djongonxt/djongonxt-model-update.md index 9aa2f7e..aeb2008 100644 --- a/docs/docs/djongonxt/djongonxt-model-update.md +++ b/docs/docs/djongonxt/djongonxt-model-update.md @@ -1,11 +1,11 @@ --- title: DjongoNxt Model Update -permalink: /djongonxt-model-update/ +permalink: /djaosdbnxt-model-update/ --- ## Bulk Write -MongoDB lets you perform [Bulk Write operations](https://docs.mongodb.com/manual/core/bulk-write-operations/) using [`bulk_write`](https://api.mongodb.com/python/current/api/pymongo/collection.html#pymongo.collection.Collection.bulk_write) which is currently not supported in Django. However, by using Djongo it is possible to perform bulk writes. +MongoDB lets you perform [Bulk Write operations](https://docs.mongodb.com/manual/core/bulk-write-operations/) using [`bulk_write`](https://api.mongodb.com/python/current/api/caosdb/collection.html#caosdb.collection.Collection.bulk_write) which is currently not supported in Django. However, by using Djongo it is possible to perform bulk writes. ```python class BulkWrite(ordered=True) @@ -20,7 +20,7 @@ Argument | Type | Description ### Example ```python -from djongo import BulkWrite +from djaosdb import BulkWrite with BulkWrite(): entry = Entry.objects.get(pk=p_key) # Queries the DB once @@ -36,7 +36,7 @@ with BulkWrite(): ### Example ```python -from djongo import BulkWrite +from djaosdb import BulkWrite with BulkWrite(ordered=False): entry = Entry.objects.get(pk=p_key) # Queries the DB once diff --git a/docs/docs/djongonxt/djongonxt-more-info.md b/docs/docs/djongonxt/djongonxt-more-info.md index aa9cd61..22c7bc3 100644 --- a/docs/docs/djongonxt/djongonxt-more-info.md +++ b/docs/docs/djongonxt/djongonxt-more-info.md @@ -1,6 +1,6 @@ --- title: More Information -permalink: /djongonxt-more-info/ +permalink: /djaosdbnxt-more-info/ toc: false --- diff --git a/docs/docs/djongonxt/djongonxt.md b/docs/docs/djongonxt/djongonxt.md index ff3abdd..10a37da 100644 --- a/docs/docs/djongonxt/djongonxt.md +++ b/docs/docs/djongonxt/djongonxt.md @@ -1,6 +1,6 @@ --- title: DjongoNxt -permalink: /djongonxt/ +permalink: /djaosdbnxt/ toc: false --- diff --git a/docs/docs/fields/using-django-with-mongodb-array-field.md b/docs/docs/fields/using-django-with-mongodb-array-field.md index 0533824..443a36a 100644 --- a/docs/docs/fields/using-django-with-mongodb-array-field.md +++ b/docs/docs/fields/using-django-with-mongodb-array-field.md @@ -27,7 +27,7 @@ Argument | Type | Description ### Example ```python -from djongo import models +from djaosdb import models from django import forms class Blog(models.Model): @@ -102,10 +102,10 @@ Note: In MongoDB the first element in the array starts at index 0. ## Using ArrayField in Django Admin -The official [Django documentation](https://docs.djangoproject.com/en/2.0/topics/db/queries/) exemplifies 3 models that interact with each other: **Blog, Author and Entry**. This tutorial considers the same 3 models. The `blog`; `ForeignKey` of the `Entry` model was optimized in the [other tutorial](/djongo/using-django-with-mongodb-data-fields/), here we optimize the `authors`; `ManyToManyField`. +The official [Django documentation](https://docs.djangoproject.com/en/2.0/topics/db/queries/) exemplifies 3 models that interact with each other: **Blog, Author and Entry**. This tutorial considers the same 3 models. The `blog`; `ForeignKey` of the `Entry` model was optimized in the [other tutorial](/djaosdb/using-django-with-mongodb-data-fields/), here we optimize the `authors`; `ManyToManyField`. ```python -from djongo import models +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -145,7 +145,7 @@ As a designer using Djongo, you have the freedom to continue with the above sche Let us redefine the `authors` in the `Entry` models using the `ArrayField`: ```python -from djongo import models +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -196,7 +196,7 @@ class Entry(models.Model): **Notice** how the `ManyToManyField` is now replaced by the `ArrayField`. To display the Array field in Django Admin, a `Form` for the field must be present. Since the array is made up of abstract `Author` models, the form can be easily created by using a `ModelForm`. If you do not specify a `ModelForm` for your array models in the `model_form_class` argument, Djongo will automatically generate a `ModelForm` for you. - + > Django Admin reveals multiple neatly nested `Name` and `Email` fields under a single Author label. diff --git a/docs/docs/fields/using-django-with-mongodb-data-fields.md b/docs/docs/fields/using-django-with-mongodb-data-fields.md index a8097d1..61a20ef 100644 --- a/docs/docs/fields/using-django-with-mongodb-data-fields.md +++ b/docs/docs/fields/using-django-with-mongodb-data-fields.md @@ -25,7 +25,7 @@ Argument | Type | Description `model_form_kwargs` | `dict()` | The kwargs (if any) that must be passed to the `forms.ModelForm` while instantiating it. ```python -from djongo import models +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -108,7 +108,7 @@ e.clean_fields() An `EmbeddedField` or `ArrayField` can be nested inside an `EmbeddedField`. There is no limitation on the depth of nesting. ```python -from djongo import models +from djaosdb import models class Tagline(models.Model) title = models.CharField(max_length=100) @@ -155,7 +155,7 @@ While creating a Form for [the ModelForm](https://docs.djangoproject.com/en/dev/ ```python -from djongo import models +from djaosdb import models from django import forms class Blog(models.Model): @@ -224,7 +224,7 @@ Django admin can use models to automatically build a site area that can be used First define our basic models. In these tutorials, the same example used in the official [Django documentation](https://docs.djangoproject.com/en/2.0/topics/db/queries/) is used. The documentation talks about 3 models that interact with each other: **Blog, Author and Entry**. To make the example clearer, few fields from the original models are omitted. ```python -from djongo import models +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -333,7 +333,7 @@ In case you don't plan on using your embedded model as a standalone model (which It is a good practice to **define embedded models as abstract models** and this is **strongly recommended**. ```python -from djongo import models +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -390,11 +390,11 @@ admin.site.register([Author, Entry]) The number of fields in the `Entry` model is reduce to 6. Fire up Django Admin to check what is up! - + Only the `Entry` and `Author` model are registered. I click on *Entrys Add* and get: - + > The `Name` and `Tagline` fields are neatly nested within Blog. `Pub date` `Mod date` `N pingbanks` and `Rating` are neatly nested within Meta data. diff --git a/docs/docs/get-started.md b/docs/docs/get-started.md index 65adb8e..91dd09c 100644 --- a/docs/docs/get-started.md +++ b/docs/docs/get-started.md @@ -10,13 +10,13 @@ description: "Djongo is a python connector for using the Django ORM with MongoDB Use MongoDB as a backend database for your Django project, without changing the Django ORM. Use Django Admin to add and modify documents in MongoDB. Start using Django with MongoDB by adding just one line of code. ## Usage -1. pip install djongo +1. pip install djaosdb 2. Into `settings.py` file of your project, add: ```python DATABASES = { 'default': { - 'ENGINE': 'djongo', + 'ENGINE': 'djaosdb', 'NAME': 'your-db-name', } } @@ -37,12 +37,12 @@ Use MongoDB as a backend database for your Django project, without changing the ## Support <!-- -[][sponsor_page] +[][sponsor_page] --> I am inundated daily with your appreciation, queries and feature requests for Djongo. Djongo has grown into a highly complex project. To support the requests, I have decided to follow an organized approach. -Djongo as a project is at a stage where its development must be transformed into a sustained effort. Djongo has more than [1,000,000 downloads](https://pypistats.org/packages/djongo) on pypi and continues to grow. I am trying to establish a sustainable development model for the project, and would [love to hear your thoughts.](https://www.patreon.com/posts/to-only-take-22611438) +Djongo as a project is at a stage where its development must be transformed into a sustained effort. Djongo has more than [1,000,000 downloads](https://pypistats.org/packages/djaosdb) on pypi and continues to grow. I am trying to establish a sustainable development model for the project, and would [love to hear your thoughts.](https://www.patreon.com/posts/to-only-take-22611438) Visit my [Patreon page][sponsor_page] to make requests and for support. You can expect immediate answers to your questions. @@ -72,7 +72,7 @@ Get [expert support][sponsor_page] for complex projects. Djongo lets you rapidly develop and evolve your app models. Modifying your models is **much faster** with Djongo compared to traditional Django ORM. Since MongoDB is a schema-less database, every time you redefine a model, MongoDB does not expect you to redefine the schema. ### Goodbye Migrations -With Djongo you **permanently say goodbye** to Django Migrations. To enable migration free model evolution simply set `ENFORCE_SCHEMA: False` in your database configuration. Djongo no longer interprets SQL DDL statements (example CREATE TABLE) to emit pymongo `create_collection` commands. With `ENFORCE_SCHEMA: False` collections are created implicitly, on the fly. +With Djongo you **permanently say goodbye** to Django Migrations. To enable migration free model evolution simply set `ENFORCE_SCHEMA: False` in your database configuration. Djongo no longer interprets SQL DDL statements (example CREATE TABLE) to emit caosdb `create_collection` commands. With `ENFORCE_SCHEMA: False` collections are created implicitly, on the fly. ## Security and Integrity Checks Djongo allows for checks on data fields before they are saved to the database. Running the correct integrity checks and field value validators before writing data into the database is important. @@ -84,7 +84,7 @@ Apply validators to each field before they are saved. ```python from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ -from djongo import models +from djaosdb import models from django.core.validators import URLValidator def script_injection(value): @@ -126,7 +126,7 @@ By setting `null=False, blank=False` in `EmbeddedField`, missing values are neve data being stored. ```python -from djongo import models +from djaosdb import models class Blog(models.Model): name = models.CharField(max_length=100) @@ -152,7 +152,7 @@ e.save() Nest a `list` of `dict` inside a model for more complex data. ```python -from djongo import models +from djaosdb import models class Entry(models.Model): blog = models.ArrayField( @@ -210,9 +210,9 @@ Support for various aggregation operators provided by MongoDB. ## Contribute -If you think djongo is useful, **please share it** with the world! Your endorsements and online reviews will help get more support for this project. +If you think djaosdb is useful, **please share it** with the world! Your endorsements and online reviews will help get more support for this project. -You can contribute to the source code or the documentation by creating a simple pull request! You may want to refer to the design documentation to get an idea on how [Django MongoDB connector](/djongo/django-mongodb-connector-design-document/) is implemented. +You can contribute to the source code or the documentation by creating a simple pull request! You may want to refer to the design documentation to get an idea on how [Django MongoDB connector](/djaosdb/django-mongodb-connector-design-document/) is implemented. Please contribute to the continued development and success of Djongo by [making a donation][sponsor_page]. diff --git a/docs/docs/home.md b/docs/docs/home.md index cf1429a..5212934 100644 --- a/docs/docs/home.md +++ b/docs/docs/home.md @@ -21,9 +21,9 @@ feature_row1: - image_path: /assets/images/mongo.jpg alt: "Unleash MongoDB on Django" title: "Unleash MongoDB" - excerpt: "Create MongoDB [embedded documents,](/djongo/using-django-with-mongodb-data-fields/) - [embedded arrays](/djongo/using-django-with-mongodb-array-field/) in Django Models, - [MongoDB specific indexes](/djongo/djongonxt-indexes/) and [transactions.](djongonxt-database-transactions/)" + excerpt: "Create MongoDB [embedded documents,](/djaosdb/using-django-with-mongodb-data-fields/) + [embedded arrays](/djaosdb/using-django-with-mongodb-array-field/) in Django Models, + [MongoDB specific indexes](/djaosdb/djaosdbnxt-indexes/) and [transactions.](djaosdbnxt-database-transactions/)" - image_path: /assets/images/feature-admin-mongo.jpg alt: "Admin MongoDB" @@ -34,15 +34,15 @@ feature_row1: alt: "Support" title: "Support" excerpt: "Get immediate support for queries on using Django with MongoDB." - url: https://nesdis.github.io/djongo/sponsor/ + url: https://nesdis.github.io/djaosdb/sponsor/ btn_label: "Learn More" btn_class: "btn--primary" - - image_path: /assets/images/djongo-symbol2.jpg + - image_path: /assets/images/djaosdb-symbol2.jpg alt: "Admin MongoDB" title: "Rapid App Development" - excerpt: "Speed up app development and execution with [schema free models](/djongo/get-started/#enforce-schema), - skip migrations, autogenerate [complex queries.](/djongo/using-django-with-mongodb-array-reference-field/)" + excerpt: "Speed up app development and execution with [schema free models](/djaosdb/get-started/#enforce-schema), + skip migrations, autogenerate [complex queries.](/djaosdb/using-django-with-mongodb-array-reference-field/)" - image_path: /assets/images/drf.jpg alt: "Admin MongoDB" @@ -50,11 +50,11 @@ feature_row1: excerpt: "Extra goodies that help interface MongoDB with Django Rest Framework." addendum_row1: - - image_path: /assets/images/djongo-Nxt-v1.png + - image_path: /assets/images/djaosdb-Nxt-v1.png alt: "Djongo Next" title: "Djongo Next" excerpt: "The next generation connector. Ships with binary extensions for professional usage." - url: https://nesdis.github.io/djongo/sponsor/ + url: https://nesdis.github.io/djaosdb/sponsor/ btn_label: "Learn More" btn_class: "btn--primary" diff --git a/docs/docs/sponsor.md b/docs/docs/sponsor.md index ca1d637..119a1bf 100644 --- a/docs/docs/sponsor.md +++ b/docs/docs/sponsor.md @@ -37,7 +37,7 @@ tires: btn_id: price_15 price_id: price_1HIKphLbyDBUaJVjQylkb7QE benefits: - - You **get access to the djongoNxt** repository. + - You **get access to the djaosdbNxt** repository. - Your questions are **immediately** taken up for consideration as priority-support. - You support the long term sustainability of the project. diff --git a/docs/docs/using-django-with-mongodb-gridfs.md b/docs/docs/using-django-with-mongodb-gridfs.md index 6695cb7..18d9c51 100644 --- a/docs/docs/using-django-with-mongodb-gridfs.md +++ b/docs/docs/using-django-with-mongodb-gridfs.md @@ -11,7 +11,7 @@ We first define our basic models. In the tutorials, we use the example used in t ```python ## models.py -from djongo import models +from djaosdb import models class Blog(models.Model): @@ -58,7 +58,7 @@ In your `models.py` file you could probably do: from django.conf import settings # Add the import for GridFSStorage -from djongo.storage import GridFSStorage +from djaosdb.storage import GridFSStorage # Define your GrifFSStorage instance diff --git a/no-response.yml b/no-response.yml deleted file mode 100644 index f4b26fa..0000000 --- a/no-response.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Number of days of inactivity before an Issue is closed for lack of response -daysUntilClose: 7 -# Label requiring a response -responseRequiredLabel: more-info-needed -# Comment to post when closing an Issue for lack of response. Set to `false` to disable -closeComment: > - This issue has been automatically closed because there has been no response - to our request for more information from the original author. With only the - information that is currently in the issue, we don't have enough information - to take action. diff --git a/requirements.txt b/requirements.txt index 5e855f4..2fe795c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ sqlparse==0.2.4 -pymongo>=3.2.0 +caosdb>=0.4.0 django>=2.0,<=3.0.5 # requirements.txt diff --git a/setup.py b/setup.py index 607465a..8ac0cbd 100644 --- a/setup.py +++ b/setup.py @@ -13,15 +13,15 @@ single django model! Usage ----- -1. Install djongo:: +1. Install djaosdb:: - pip install djongo + pip install djaosdb 2. Into settings.py file of your project, add:: DATABASES = { 'default': { - 'ENGINE': 'djongo', + 'ENGINE': 'djaosdb', 'NAME': 'your-db-name', } } @@ -57,8 +57,8 @@ and others... fully supported. Important links --------------- -* `Full Documentation <https://nesdis.github.io/djongo/>`_ -* `Source code <https://github.com/nesdis/djongo>`_ +* `Full Documentation <https://nesdis.github.io/djaosdb/>`_ +* `Source code <https://github.com/nesdis/djaosdb>`_ """ @@ -82,7 +82,7 @@ def find_version(*file_paths): install_requires = [ 'sqlparse==0.2.4', - 'pymongo>=3.2.0', + 'caosdb>=0.4.0', 'django>=2.1,<=3.0.5', ] @@ -90,11 +90,11 @@ if sys.version_info.major == 3 and sys.version_info.minor < 7: install_requires.append("dataclasses") setup( - name='djongo', - version=find_version("djongo", "__init__.py"), + name='djaosdb', + version=find_version("djaosdb", "__init__.py"), include_package_data=True, packages=packages, - url='https://nesdis.github.io/djongo/', + url='https://nesdis.github.io/djaosdb/', license='AGPL', author='nesdis', author_email='nesdis@gmail.com', diff --git a/tests/django_tests/test_utils/settings/test_mongodb.py b/tests/django_tests/test_utils/settings/test_mongodb.py index b8ac050..f59aa61 100644 --- a/tests/django_tests/test_utils/settings/test_mongodb.py +++ b/tests/django_tests/test_utils/settings/test_mongodb.py @@ -15,12 +15,12 @@ import sys DATABASES = { 'default': { - 'ENGINE': 'djongo', + 'ENGINE': 'djaosdb', 'NAME': 'test1', 'ENFORCE_SCHEMA': True, }, 'other': { - 'ENGINE': 'djongo', + 'ENGINE': 'djaosdb', 'NAME': 'test2', 'ENFORCE_SCHEMA': True } diff --git a/tests/django_tests/test_utils/test_runner.py b/tests/django_tests/test_utils/test_runner.py index 6bb5142..c109ac0 100644 --- a/tests/django_tests/test_utils/test_runner.py +++ b/tests/django_tests/test_utils/test_runner.py @@ -24,13 +24,13 @@ class TextTestResult(BaseTextTestResult): super().addSuccess(test) self.stream.writeln('## Ending Test ##') self.passed.append((test, '')) - logger = getLogger('djongo') + logger = getLogger('djaosdb') logger.setLevel(INFO) def startTest(self, test): self.stream.writeln('## Starting Test ##') super().startTest(test) - logger = getLogger('djongo') + logger = getLogger('djaosdb') logger.setLevel(INFO) if logger.hasHandlers(): logger.removeHandler(self.handler) diff --git a/tests/django_tests/tests/v22/tests/runtests.py b/tests/django_tests/tests/v22/tests/runtests.py index 20e0892..b26721b 100644 --- a/tests/django_tests/tests/v22/tests/runtests.py +++ b/tests/django_tests/tests/v22/tests/runtests.py @@ -272,7 +272,7 @@ def django_tests(verbosity, interactive, failfast, keepdb, reverse, extra_tests = [] # Run the test suite, including the extra validation tests. - sys.path.insert(0, '/home/esidsen/projects/djongo/tests/django_tests/test_utils') + sys.path.insert(0, '/home/esidsen/projects/djaosdb/tests/django_tests/test_utils') if not hasattr(settings, 'TEST_RUNNER'): settings.TEST_RUNNER = 'django.test.runner.DiscoverRunner' settings.TEST_RUNNER = 'test_runner.DiscoverRunner' diff --git a/tests/djongo_tests/test_project/test_project/settings/settings_lite.py b/tests/djongo_tests/test_project/test_project/settings/settings_lite.py index a8b0246..e020677 100644 --- a/tests/djongo_tests/test_project/test_project/settings/settings_lite.py +++ b/tests/djongo_tests/test_project/test_project/settings/settings_lite.py @@ -28,13 +28,13 @@ ALLOWED_HOSTS = ['localhost','127.0.0.1'] DATABASES = { 'default': { - 'ENGINE': 'djongo', - 'NAME': 'djongo-test', + 'ENGINE': 'djaosdb', + 'NAME': 'djaosdb-test', 'ENFORCE_SCHEMA': False, 'LOGGING': { 'version': 1, 'loggers': { - 'djongo': { + 'djaosdb': { 'level': 'DEBUG', 'propagate': False, 'handlers': ['console'] diff --git a/tests/djongo_tests/test_project/test_project/settings/settings_loaded.py b/tests/djongo_tests/test_project/test_project/settings/settings_loaded.py index a4049b9..8a89f09 100644 --- a/tests/djongo_tests/test_project/test_project/settings/settings_loaded.py +++ b/tests/djongo_tests/test_project/test_project/settings/settings_loaded.py @@ -29,11 +29,11 @@ ALLOWED_HOSTS = ['localhost', '127.0.0.1'] DATABASES = { 'default': { - 'ENGINE': 'djongo', - 'NAME': 'djongo-test', + 'ENGINE': 'djaosdb', + 'NAME': 'djaosdb-test', 'CLIENT': { - 'host': '127.0.0.1', - 'port': 27017, + 'host': 'localhost', + 'port': 10443, 'authSource': 'admin', }, 'ENFORCE_SCHEMA': True @@ -43,7 +43,7 @@ DATABASES = { INSTALLED_APPS = [ 'xtest_app.apps.XtestAppConfig', - 'djongo.dynamic_formsets.apps.DynamicFormsetsConfig', + 'djaosdb.dynamic_formsets.apps.DynamicFormsetsConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/tests/djongo_tests/test_project/test_project/settings/settings_loaded_formsets.py b/tests/djongo_tests/test_project/test_project/settings/settings_loaded_formsets.py index da5a2ba..702ca94 100644 --- a/tests/djongo_tests/test_project/test_project/settings/settings_loaded_formsets.py +++ b/tests/djongo_tests/test_project/test_project/settings/settings_loaded_formsets.py @@ -29,11 +29,11 @@ ALLOWED_HOSTS = ['localhost','127.0.0.1'] DATABASES = { 'default': { - 'ENGINE': 'djongo', - 'NAME': 'djongo-test', + 'ENGINE': 'djaosdb', + 'NAME': 'djaosdb-test', # 'USER': 'user', # 'PASSWORD': 'passpass', - # 'AUTH_SOURCE': 'djongo-test', + # 'AUTH_SOURCE': 'djaosdb-test', 'ENFORCE_SCHEMA': True }, @@ -42,7 +42,7 @@ DATABASES = { INSTALLED_APPS = [ 'xtest_app.apps.XtestAppConfig', - 'djongo.dynamic_formsets.apps.DynamicFormsetsConfig', + 'djaosdb.dynamic_formsets.apps.DynamicFormsetsConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/tests/djongo_tests/test_project/test_project/settings/settings_precheckin.py b/tests/djongo_tests/test_project/test_project/settings/settings_precheckin.py index d510f3a..c777dd0 100644 --- a/tests/djongo_tests/test_project/test_project/settings/settings_precheckin.py +++ b/tests/djongo_tests/test_project/test_project/settings/settings_precheckin.py @@ -29,8 +29,8 @@ ALLOWED_HOSTS = ['localhost','127.0.0.1'] DATABASES = { 'default': { - 'ENGINE': 'djongo', - 'NAME': 'djongo-test', + 'ENGINE': 'djaosdb', + 'NAME': 'djaosdb-test', 'ENFORCE_SCHEMA': False }, diff --git a/tests/djongo_tests/test_project/xtest_app/models/admin_tests.py b/tests/djongo_tests/test_project/xtest_app/models/admin_tests.py index 7681102..b2256d4 100644 --- a/tests/djongo_tests/test_project/xtest_app/models/admin_tests.py +++ b/tests/djongo_tests/test_project/xtest_app/models/admin_tests.py @@ -1,4 +1,4 @@ -from djongo import models +from djaosdb import models from .basic_field import NamedAuthor, HeadlinedEntry diff --git a/tests/djongo_tests/test_project/xtest_app/models/basic_field.py b/tests/djongo_tests/test_project/xtest_app/models/basic_field.py index 8488c28..74889cb 100644 --- a/tests/djongo_tests/test_project/xtest_app/models/basic_field.py +++ b/tests/djongo_tests/test_project/xtest_app/models/basic_field.py @@ -1,4 +1,4 @@ -from djongo import models +from djaosdb import models class Entry(models.Model): diff --git a/tests/djongo_tests/test_project/xtest_app/models/canvas_models_id.py b/tests/djongo_tests/test_project/xtest_app/models/canvas_models_id.py index 06ad9d8..b110ba3 100644 --- a/tests/djongo_tests/test_project/xtest_app/models/canvas_models_id.py +++ b/tests/djongo_tests/test_project/xtest_app/models/canvas_models_id.py @@ -1,7 +1,7 @@ import json # from django.db import models -from djongo import models +from djaosdb import models # # class ForeignKey1(models.Model): diff --git a/tests/djongo_tests/test_project/xtest_app/models/reference_field.py b/tests/djongo_tests/test_project/xtest_app/models/reference_field.py index 012d52f..3779452 100644 --- a/tests/djongo_tests/test_project/xtest_app/models/reference_field.py +++ b/tests/djongo_tests/test_project/xtest_app/models/reference_field.py @@ -1,4 +1,4 @@ -from djongo import models +from djaosdb import models from .basic_field import NamedAuthor, HeadlinedEntry diff --git a/tests/djongo_tests/test_project/xtest_app/tests/__init__.py b/tests/djongo_tests/test_project/xtest_app/tests/__init__.py index b97527a..98790dd 100644 --- a/tests/djongo_tests/test_project/xtest_app/tests/__init__.py +++ b/tests/djongo_tests/test_project/xtest_app/tests/__init__.py @@ -3,9 +3,9 @@ from typing import Any from unittest.util import safe_repr from django.conf import settings -from pymongo import MongoClient -from pymongo.database import Database -from djongo.models import Model +from caosdb import MongoClient +from caosdb.database import Database +from djaosdb.models import Model from django.test import TestCase as DjangoTestCase from logging import getLogger, StreamHandler, DEBUG diff --git a/tests/djongo_tests/test_project/xtest_app/tests/test_canvas.py b/tests/djongo_tests/test_project/xtest_app/tests/test_canvas.py index 9b29d6b..759b7ca 100644 --- a/tests/djongo_tests/test_project/xtest_app/tests/test_canvas.py +++ b/tests/djongo_tests/test_project/xtest_app/tests/test_canvas.py @@ -1,7 +1,7 @@ from django.db.models import QuerySet from . import TestCase -from djongo import models +from djaosdb import models class Team(models.Model): id = models.TextField() diff --git a/tests/djongo_tests/test_project/xtest_app/tests/test_models.py b/tests/djongo_tests/test_project/xtest_app/tests/test_models.py index b69efc2..14dfdb9 100644 --- a/tests/djongo_tests/test_project/xtest_app/tests/test_models.py +++ b/tests/djongo_tests/test_project/xtest_app/tests/test_models.py @@ -1,9 +1,9 @@ from unittest import skip from django.core.exceptions import ValidationError -from djongo.exceptions import NotSupportedError +from djaosdb.exceptions import NotSupportedError from xtest_app.models.basic_field import BasicBlog, BasicRelatedEntry, BasicAuthor from . import TestCase -from djongo import models +from djaosdb import models from xtest_app.models import basic_field from typing import Type, Optional as O, Union as U, Any diff --git a/tests/mock_tests/test_sqlparsing.py b/tests/mock_tests/test_sqlparsing.py index 7966877..c698047 100644 --- a/tests/mock_tests/test_sqlparsing.py +++ b/tests/mock_tests/test_sqlparsing.py @@ -4,11 +4,11 @@ from logging import getLogger, DEBUG, StreamHandler from unittest import TestCase, mock, skip from unittest.mock import patch, MagicMock, call -from pymongo.command_cursor import CommandCursor -from pymongo.cursor import Cursor +from caosdb.command_cursor import CommandCursor +from caosdb.cursor import Cursor -from djongo.base import DatabaseWrapper -from djongo.sql2mongo.query import Query +from djaosdb.base import DatabaseWrapper +from djaosdb.sql2mongo.query import Query sqls = [ 'UPDATE "auth_user" ' @@ -197,7 +197,7 @@ t4c2 = '"table4"."col2"' t1 = '"table1"' where = 'SELECT "table1"."col1" FROM "table1" WHERE' -logger = getLogger('djongo') +logger = getLogger('djaosdb') logger.setLevel(DEBUG) logger.addHandler(StreamHandler()) @@ -217,7 +217,7 @@ class MockTest(TestCase): cls.params: typing.Union[mock.MagicMock, list] = None def setUp(self): - patcher = patch('djongo.sql2mongo.query.print_warn') + patcher = patch('djaosdb.sql2mongo.query.print_warn') self.addCleanup(patcher.stop) self.print_warn = patcher.start() @@ -2331,7 +2331,7 @@ class TestDatabaseWrapper(TestCase): wrapper = DatabaseWrapper(settings_dict) params = wrapper.get_connection_params() - self.assertEqual(params['name'], 'djongo_test') + self.assertEqual(params['name'], 'djaosdb_test') self.assertEqual(params['enforce_schema'], False) def test_connection_params(self): @@ -2355,7 +2355,7 @@ class TestDatabaseWrapper(TestCase): self.assertIs(params['port'], port) self.assertIs(params['host'], host) - @patch('djongo.database.MongoClient') + @patch('djaosdb.database.MongoClient') def test_connection(self, mocked_mongoclient): settings_dict = MagicMock(dict) wrapper = DatabaseWrapper(settings_dict) diff --git a/tests/precheckin.py b/tests/precheckin.py index 4550420..c094590 100644 --- a/tests/precheckin.py +++ b/tests/precheckin.py @@ -5,7 +5,7 @@ import subprocess import sys import unittest -from pymongo import MongoClient +from caosdb import MongoClient from mock_tests import test_sqlparsing client = MongoClient() @@ -27,7 +27,7 @@ def run_test_sqlparsing(): def run_commands(path): with client: - client.drop_database('djongo-test') + client.drop_database('djaosdb-test') manage_py = os.path.join(path, "manage.py") cmds = [ @@ -49,7 +49,7 @@ def run_commands(path): if __name__ == '__main__': run_test_sqlparsing() - app_root = os.path.join(TEST_DIR, 'djongo_tests', 'test_project') + app_root = os.path.join(TEST_DIR, 'djaosdb_tests', 'test_project') main_test_app = os.path.join(app_root, 'xtest_app') remove_migrations(main_test_app) run_commands(app_root) -- GitLab