diff --git a/LICENSE b/LICENSE index d81188a..68428fd 100755 --- a/LICENSE +++ b/LICENSE @@ -26,3 +26,41 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +============================================================================= + +ADDITIONAL ATTRIBUTION NOTICE: + +Parts of this software are based on the Django project, which is licensed +under the three-clause BSD license. The original Django project is +copyright (c) Django Software Foundation and individual contributors. + +Original Django License: + +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of Django nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index 6effd16..0988c0f 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ # GaussDB dialect for Django +![PyPI](https://img.shields.io/pypi/v/gaussdb-django) +![PyPI - Python Version](https://img.shields.io/pypi/pyversions/gaussdb-django) -This adds compatibility for [GaussDB](https://github.com/HuaweiCloudDeveloper/gaussdb-django) to Django. +This adds compatibility for [GaussDB](https://www.huaweicloud.com/product/gaussdb.html) to Django. + + +## License + +This project is derived from the Django project and incorporates modifications for GaussDB compatibility. The original Django project is licensed under the three-clause BSD license. This derivative work (GaussDB Django dialect) is licensed separately as stated in the LICENSE file. + +Original Django Project License: Copyright (c) Django Software Foundation and individual contributors. All rights reserved. ## Installation Guide diff --git a/example/wagtail_README.md b/example/wagtail_README.md index 64d8d2a..64252c0 100644 --- a/example/wagtail_README.md +++ b/example/wagtail_README.md @@ -52,7 +52,6 @@ python3.10 --version --- - ## 创建用户 创建wagtail用户,并切换到该用户下进行后续操作。 @@ -84,13 +83,13 @@ mkdir -p ~/.pip && echo -e "[global]\nindex-url = https://pypi.tuna.tsinghua.edu ```bash # 创建虚拟环境 # 注意:因为gaussdb-django需要python3.10 -python3.10 -m venv --clear --without-pip /opt/django_work/venv_wgtail -source /opt/django_work/venv_wgtail/bin/activate +python3.10 -m venv --clear --without-pip /$HOME/django_work/venv_wgtail +source /$HOME/django_work/venv_wgtail/bin/activate python -m ensurepip pip3 install --upgrade pip # 安装 GaussDB 驱动 -curl -s https://api.github.com/repos/pangpang20/gaussdb-django/contents/install_gaussdb_driver.sh?ref=5.2.0 | jq -r '.content' | base64 --decode > install_gaussdb_driver.sh +curl -s https://api.github.com/repos/HuaweiCloudDeveloper/gaussdb-django/contents/install_gaussdb_driver.sh?ref=5.2.0 | jq -r '.content' | base64 --decode > install_gaussdb_driver.sh chmod u+x install_gaussdb_driver.sh source install_gaussdb_driver.sh diff --git a/gaussdb_django/__init__.py b/gaussdb_django/__init__.py index 20bb87a..4202e38 100755 --- a/gaussdb_django/__init__.py +++ b/gaussdb_django/__init__.py @@ -1,3 +1,16 @@ +""" +GaussDB Django dialect - initialization module. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + from .base import DatabaseWrapper __all__ = ["DatabaseWrapper"] diff --git a/gaussdb_django/base.py b/gaussdb_django/base.py index d46326a..87ffd2d 100755 --- a/gaussdb_django/base.py +++ b/gaussdb_django/base.py @@ -1,8 +1,17 @@ """ -Gaussdb database backend for Django. - -Requires gaussdb >= 1.0.3 +GaussDB database backend for Django. +Based on Django's PostgreSQL backend with modifications for GaussDB compatibility. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. """ + import asyncio import threading import warnings diff --git a/gaussdb_django/client.py b/gaussdb_django/client.py index 76fc311..db05dc7 100755 --- a/gaussdb_django/client.py +++ b/gaussdb_django/client.py @@ -1,3 +1,16 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import signal from django.db.backends.base.client import BaseDatabaseClient diff --git a/gaussdb_django/compiler.py b/gaussdb_django/compiler.py index 115cbff..437b679 100755 --- a/gaussdb_django/compiler.py +++ b/gaussdb_django/compiler.py @@ -1,3 +1,16 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + from django.db.models.sql.compiler import ( SQLAggregateCompiler, SQLCompiler, diff --git a/gaussdb_django/creation.py b/gaussdb_django/creation.py index bc4d23f..6f677ab 100755 --- a/gaussdb_django/creation.py +++ b/gaussdb_django/creation.py @@ -1,3 +1,16 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import sys from django.core.exceptions import ImproperlyConfigured diff --git a/gaussdb_django/expressions.py b/gaussdb_django/expressions.py index 808d7ee..eda743d 100644 --- a/gaussdb_django/expressions.py +++ b/gaussdb_django/expressions.py @@ -1,3 +1,16 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + from django.db.models import Func diff --git a/gaussdb_django/features.py b/gaussdb_django/features.py index 544d5b1..86052b0 100755 --- a/gaussdb_django/features.py +++ b/gaussdb_django/features.py @@ -1,3 +1,16 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + from django.db import DataError, InterfaceError from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property diff --git a/gaussdb_django/gaussdb_any.py b/gaussdb_django/gaussdb_any.py index ecdeb17..e40bfb6 100755 --- a/gaussdb_django/gaussdb_any.py +++ b/gaussdb_django/gaussdb_any.py @@ -1,3 +1,16 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import ipaddress from functools import lru_cache diff --git a/gaussdb_django/introspection.py b/gaussdb_django/introspection.py index a0c02a0..a1846aa 100755 --- a/gaussdb_django/introspection.py +++ b/gaussdb_django/introspection.py @@ -1,3 +1,16 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import re from collections import namedtuple diff --git a/gaussdb_django/operations.py b/gaussdb_django/operations.py index 4e300f0..a2d4fb0 100755 --- a/gaussdb_django/operations.py +++ b/gaussdb_django/operations.py @@ -1,3 +1,16 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + import json from functools import lru_cache, partial from django.conf import settings diff --git a/gaussdb_django/schema.py b/gaussdb_django/schema.py index 53857cd..556cbd5 100755 --- a/gaussdb_django/schema.py +++ b/gaussdb_django/schema.py @@ -1,3 +1,16 @@ +""" +GaussDB schema module for Django. +This module incorporates code from the Django project, which is +licensed under the three-clause BSD license. +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. +This derivative work is licensed under the same BSD license. +Copyright (c) 2025, HuaweiCloudDeveloper +All rights reserved. +For more information about Django's license, see the LICENSE file in the +root directory of this distribution. +""" + from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.backends.ddl_references import IndexColumns from .gaussdb_any import sql diff --git a/install_gaussdb_driver.sh b/install_gaussdb_driver.sh index b098ae7..f7a2df7 100755 --- a/install_gaussdb_driver.sh +++ b/install_gaussdb_driver.sh @@ -64,7 +64,7 @@ OS_TYPE="" if [[ -f /etc/os-release ]]; then . /etc/os-release case "$ID" in - centos|hce) + centos|hce|openEuler) if [[ -d "$DRIVER_DIR/Hce2_$ARCH_TYPE" ]]; then OS_TYPE="Hce2_$ARCH_TYPE" fi diff --git a/pyproject.toml b/pyproject.toml index 90f7ae8..1cc8426 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,15 +4,16 @@ build-backend = "setuptools.build_meta" [project] name = "gaussdb-django" -version = "5.2.0" +version = "5.2.1" description = "Django backend for GaussDB" readme = "README.md" requires-python = ">=3.10" +license = "BSD-3-Clause" +license-files = ["LICENSE"] classifiers = [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Framework :: Django :: 5.2", - "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3",