diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 0c420b90be0aa1fa6f1e14538b88bcbbee205bc6..0000000000000000000000000000000000000000 --- 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 dbf6e3eeed36723baf15b2a8063dfe12aaefce8c..0000000000000000000000000000000000000000 --- 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 4f305e96f9f549276b7a71e92c39151c17fd9daf..0000000000000000000000000000000000000000 --- 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 f1161b1256f91a36c25083c2bee09af537c553b7..944f8bf707b8105eb0061a8b8f0390171e7e4359 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 7f32d838eca60cdeceb18b005962551e7519aa90..a20f209014283a58f8b9ea408414c95f82666074 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 a49d1fa495bf000258d0031cecf709664b4d8787..ea3ffc9f1295f3e0555be3cb8ca12bea76a36824 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 91cdf7c3c004b205a80c9eb66a3d06bdc6aa7998..f4a89b6ed17d7dc1db6813c0c8bc1fa4c57153be 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 6dab52e2866412b476e088d3769cd7e93d0fe7ef..9fdff29e0d6dfca73feca12b9cc0e2735d894851 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 86ad27de6a2a2acc1701c721a2e462843fa42949..cfa4f52934212ff7a77ff34509d7a22f35616bd4 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 f8ab97e6221b4cd717875f3d07845d4c5ea25e51..d3b134e4e1e061559eb818930f4101eacf78fda0 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 357fd8d92af37df165eb3f10faaca7141022f887..88c610aff3cea2c0717b6580409a270b8ef83a75 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 03af82f22e1f5f70b1f351157c9af81dd4adba96..46a86566bd22c8906a17657967344364a5a56543 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 acfee1e3fd888b55d947a83f38b539a250b89152..8ca8443f5651dc889c71462df8851e5691042b0a 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 3921a4bcc3b10925c7b56b97c033dfdebd0b7bf8..6bae9a96586ddc1766e2604ad1a6a454e4b50be7 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 91907a8784773530dec7f63de37ee5053d0e90fb..275f28ebaebc12e4d8bcd815615e514bf1c4adba 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 0000000000000000000000000000000000000000..b7f444451921212bd67d0eb7ac67b801dc74a51f --- /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 aa2cdf3b42e2f428ade4a156ae34752ca5d8504d..2591d290affd00f8e8f563e735dd858053d7bb7d 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 0000000000000000000000000000000000000000..3907e10648416847150e48dbfc7fa12068ca0947 --- /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 0000000000000000000000000000000000000000..2d51b150ced7e5d0f13f0cfe881a76f3266c1978 --- /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 41a726c2f27246ef3e9a96149953f853deb0b9f6..a65dd6145453eb2d22b54ac84a614e2d67fee6ae 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 f21e5e62f6cc3809597ee6daa381a77ac5607e78..6dc99b3bfdfeb75e65201b02c4443145f31d8f86 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 d5eab7245ca810cdd9db765a73b9899ee83fd2c0..a4be6b29a8022a417dee2ec6c4a70ccd688bc8f3 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 0000000000000000000000000000000000000000..c9ba6300ffaad1bcf381cc6570b2c9118ec29a16 --- /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 dfc56645ae76c3ca8321e8899b0fb2bbd162047d..0000000000000000000000000000000000000000 --- 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 677d6becbdd922f8bbe329e096ce99cc513dc8d9..0000000000000000000000000000000000000000 --- 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 236890a5c7356cc205f8b55dec44c06054353eb4..0000000000000000000000000000000000000000 --- 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 0ce03de5ff1333ddf27660c31058f18b3f5ad1b0..0000000000000000000000000000000000000000 --- 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 0904654f64bd6e90adcdc184250fd1fe7bc969de..d86c5a4301b12af1441fa8c4fb79e21cde138b6b 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 fe2d41fe62d7f543af0490ff49c0dd5b4759bd98..8e118a80e517dfb32769e514d873f5eb0a10f65a 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 89198170bde885dc609151f3d8563cff2cc0f154..4ebf892028dedec84c8b30ca052ca13ce8023422 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 b21e4187cbbdf1108c9fefa40e864ed03bf6d1e9..bca0fbb0d9ac1c0a9ab20f44febf96f061ed07a4 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 6d31baacb56e43657b1fda84be3b941970239bce..9bf8206302e993b63e6098cc24b90522d62b3e03 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 8637d8bc36c2f8841720ce27c7af691915914171..c5b9fc349942575c0f413379175a974aefd5d372 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 320322e3637536fe8a463493b45ea43403de53a6..b5b3a6a5903561c4baf62bafbc6079f5cfbae87d 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 ede26c554f97a46b17a3da9e89a9cc4266f237b0..22fc2b3b6c17695d74e605afcc537ec9be36f2c3 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 6d713941f3e26f20bf6d66e151ae2a7012664b31..d4797aa0e14964d9a7a41a219f31da4890fda629 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 887058032e547e6cfef75a5dccd4fb5acc1a853f..573bd9d4afe963438395f6b26ccb51ec8c97a171 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 7ff9fa1d88fa8ad286a08358377eebccaa6ff058..89e142f9f6cc0e73967c7d77d13bee568d1ba23c 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 3e3c3e613585eaced6b3738e8f33220ccc3ebdb8..07174df8f73f1f6b8f301992775edf09082a05f5 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 db9585c8cbc5cc84c6069764aaa5756fb032c585..029a7e7f56e016788706c0f7c0b87e3f1eac786b 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 e01c781b9a86affed07b6dc718f555a42001950c..f321875bf94eac0bbc8f18d5819ec736e423a167 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 667b2252710ac7b33ff18b540afe2bdbca3ef6ca..8a0ab23f8d2aec9ce81d4f41c793fd3bf4d1e523 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 7332d39a67db430102d9570ec5dfad38935fa99d..7c4c5cf08ec31800c635034d36c008804776edeb 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 56b2f4ed390ec39d01d696d482243b9aedce4fd4..e64d8e453986e6baaaf487c907addaba587498a5 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 b87ea7dadf178a67034041007a96c3a225828165..c4c2a36c1c899630f3928135f72a0d5dc84149ff 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 6fe4afa54fc4936dd88868151470f13e3daacf81..810d09e00a346b81783076de76696403ddf85346 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 0ad3dcc088681d015ca4dcb1bac3eea0909e0fb6..32c80994e8dbe098ec2cb45ae87b4d9bc59a837d 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 9aa2f7e452f856a92572c6076d8ce3ea44821bd0..aeb2008a39345850eedd53e373cc888624dbb506 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 aa9cd617c3ef6f2e77923284deb3f187e555b302..22c7bc35f2a28a83ad158ffa46d6dd12bda01258 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 ff3abdd642a9f49a885289ddf9805c21260e63e6..10a37dacb2e71b0c8165c3a3407d4839967d8cc6 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 0533824863ff0de5657abbb14664cab5c7604bd3..443a36a5575d932430e25a6696fc8d9e339fbf32 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 a8097d1155b2925028c8072e709083a1ff5b0476..61a20efbb3d06f5231d772b020859c7bf48b5f33 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 65adb8e8a8d3b6d47c3b1b21f7698bcd20cc450f..91dd09c4c5802b91f10b80ec06920a6832949869 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 cf1429a8ba276bcee26e1a1c3c70012981988dca..52129345738ff1b4091af991e65be4bb78a2b461 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 ca1d637ec0a7744cad1f4192b6a21f44f908bcc1..119a1bf41c787f0fd19705546862c6536b84bcc6 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 6695cb7b3f9c15ca65ec60b9ac77630c3e070aff..18d9c51c00a4c109613e02da96ebaab1f52725b5 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 f4b26fa7797b7de1a02622b580769164c233a27c..0000000000000000000000000000000000000000 --- 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 5e855f40dc99d53a7b91ed1b7c4662d09a0d1aa8..2fe795c4bdef07e443fc1d09889d69d783976039 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 607465a949add731354ed754265cb96090bcf1a0..8ac0cbd64896c3d70a257c98b28851529307fd43 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 b8ac050c49f2d598c70f1fe032a1694d1909bc3e..f59aa6172d6721a42c659eb7caffab91765f552e 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 6bb5142a75f9935fbcf0c5e530d4cd8bde9c958d..c109ac05855ba6ccb936a950f127cada344cc954 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 20e0892dd97fc5dafa080e99f32eff01faf9d318..b26721b59828b85f4fe4d5f13f12909b7a8f866d 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 a8b0246d0ea5f0c395ecc96d1ca818c4844d6abe..e0206772293f881e4c27fa94969054966e1e6fea 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 a4049b9dea3774648c7804773fa25d891e13725d..8a89f0939d44bc2e679093d5fd8baebe4e35c78f 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 da5a2baed7ca19e61e2dcf45d44f1a149b82c791..702ca94dc2aad14e7686a4dfdb194fa35ac4fe1a 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 d510f3aa0ec53df902ea6f1673c526e8d080aafe..c777dd07b44ffacfc66b78cde6a29a396a41624b 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 7681102f904d2885a3cc411b83660c16f1c2724d..b2256d47867ae03ae8655405b9da6d496f264e67 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 8488c2857063441d15af8685cc9d9017b3bd5b50..74889cb5492bc571570edab2f78797add132aafc 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 06ad9d8935529220277917791674e105c35e894b..b110ba39731ec6951a22dc09cc1ad39faaf515af 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 012d52fb2ee8c9756bf23e18d9d573caa56ba0fd..377945262150922fdbad6f5f41c4b6940bb0e7c2 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 b97527abc4a14d8f3ebcc457893aa0653d7f68e8..98790dda906c3547f15390a26ea4adc8cec3205e 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 9b29d6bc27b09fe428afa6874a371f9d12f31851..759b7ca8eec70545adda3bb6f97abaa132584d35 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 b69efc2b028964812bf4aa8d4852fbf10e9127d4..14dfdb97e697d50e32287c47fbc3afbb7fb83731 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 796687785c2072d9642c41549064ff96d93850a3..c698047ef64d570aff01f3a09da9b6201678add5 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 455042024a9537f9d92983bd8530107bd44ae0bc..c094590c6bdfb413844fd7ce0ad1011546df5586 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)