diff --git a/.gitignore b/.gitignore index ef45ccd..e2bf9b4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ venv !CHANGELOG.md !README.md /*.md +/venv* +/dist +/django_translatable_fields/dist/ diff --git a/django_translatable_fields.egg-info/PKG-INFO b/django_translatable_fields.egg-info/PKG-INFO index 482d88f..7540d04 100644 --- a/django_translatable_fields.egg-info/PKG-INFO +++ b/django_translatable_fields.egg-info/PKG-INFO @@ -1,4 +1,4 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.4 Name: django-translatable-fields Version: 0.1.0 Summary: Django plugin that mimics Odoo's translate=True functionality with admin interface integration @@ -52,9 +52,19 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks Classifier: Topic :: Software Development :: Libraries :: Python Modules Requires-Python: >=3.9 Description-Content-Type: text/markdown -Provides-Extra: dev -Provides-Extra: drf License-File: LICENSE +Requires-Dist: Django>=4.2 +Provides-Extra: dev +Requires-Dist: pytest; extra == "dev" +Requires-Dist: pytest-django; extra == "dev" +Requires-Dist: black; extra == "dev" +Requires-Dist: isort; extra == "dev" +Requires-Dist: flake8; extra == "dev" +Requires-Dist: mypy; extra == "dev" +Requires-Dist: django-stubs; extra == "dev" +Provides-Extra: drf +Requires-Dist: djangorestframework>=3.14.0; extra == "drf" +Dynamic: license-file # Django Translatable Fields diff --git a/django_translatable_fields.egg-info/requires.txt b/django_translatable_fields.egg-info/requires.txt index c5937f8..66535ac 100644 --- a/django_translatable_fields.egg-info/requires.txt +++ b/django_translatable_fields.egg-info/requires.txt @@ -1,13 +1,13 @@ Django>=4.2 [dev] -black -django-stubs -flake8 -isort -mypy pytest pytest-django +black +isort +flake8 +mypy +django-stubs [drf] djangorestframework>=3.14.0 diff --git a/django_translatable_fields/django_translatable_fields.egg-info/PKG-INFO b/django_translatable_fields/django_translatable_fields.egg-info/PKG-INFO new file mode 100644 index 0000000..13807a8 --- /dev/null +++ b/django_translatable_fields/django_translatable_fields.egg-info/PKG-INFO @@ -0,0 +1,55 @@ +Metadata-Version: 2.4 +Name: django-translatable-fields +Version: 0.1.0 +Summary: Django fields with Odoo-style translate=True functionality +Home-page: https://github.com/holger/django-translatable-fields +Author: Holger Sielaff +Author-email: holger@backender.de +Keywords: django,translation,i18n,l10n,fields,postgresql,json,odoo +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: Web Environment +Classifier: Framework :: Django +Classifier: Framework :: Django :: 4.2 +Classifier: Framework :: Django :: 5.0 +Classifier: Framework :: Django :: 5.1 +Classifier: Framework :: Django :: 5.2 +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Internet :: WWW/HTTP +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Database +Classifier: Topic :: Text Processing :: Linguistic +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +Requires-Dist: Django<6.0,>=4.2 +Requires-Dist: psycopg2-binary>=2.9.0 +Provides-Extra: dev +Requires-Dist: pytest>=7.0.0; extra == "dev" +Requires-Dist: pytest-django>=4.5.0; extra == "dev" +Requires-Dist: black>=22.0.0; extra == "dev" +Requires-Dist: flake8>=4.0.0; extra == "dev" +Requires-Dist: mypy>=0.991; extra == "dev" +Provides-Extra: postgres +Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: keywords +Dynamic: provides-extra +Dynamic: requires-dist +Dynamic: requires-python +Dynamic: summary + +Django Translatable Fields - Odoo-style translatable fields for Django diff --git a/django_translatable_fields/django_translatable_fields.egg-info/SOURCES.txt b/django_translatable_fields/django_translatable_fields.egg-info/SOURCES.txt new file mode 100644 index 0000000..cfd0209 --- /dev/null +++ b/django_translatable_fields/django_translatable_fields.egg-info/SOURCES.txt @@ -0,0 +1,13 @@ +setup.py +django_translatable_fields.egg-info/PKG-INFO +django_translatable_fields.egg-info/SOURCES.txt +django_translatable_fields.egg-info/dependency_links.txt +django_translatable_fields.egg-info/entry_points.txt +django_translatable_fields.egg-info/not-zip-safe +django_translatable_fields.egg-info/requires.txt +django_translatable_fields.egg-info/top_level.txt +management/__init__.py +management/commands/__init__.py +management/commands/makemigrations_translatable.py +templatetags/__init__.py +templatetags/translatable_tags.py \ No newline at end of file diff --git a/django_translatable_fields/django_translatable_fields.egg-info/dependency_links.txt b/django_translatable_fields/django_translatable_fields.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/django_translatable_fields/django_translatable_fields.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/django_translatable_fields/django_translatable_fields.egg-info/entry_points.txt b/django_translatable_fields/django_translatable_fields.egg-info/entry_points.txt new file mode 100644 index 0000000..cf06e8f --- /dev/null +++ b/django_translatable_fields/django_translatable_fields.egg-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +translatable-migrate = django_translatable_fields.management.commands.makemigrations_translatable:main diff --git a/django_translatable_fields/django_translatable_fields.egg-info/not-zip-safe b/django_translatable_fields/django_translatable_fields.egg-info/not-zip-safe new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/django_translatable_fields/django_translatable_fields.egg-info/not-zip-safe @@ -0,0 +1 @@ + diff --git a/django_translatable_fields/django_translatable_fields.egg-info/requires.txt b/django_translatable_fields/django_translatable_fields.egg-info/requires.txt new file mode 100644 index 0000000..5113dc3 --- /dev/null +++ b/django_translatable_fields/django_translatable_fields.egg-info/requires.txt @@ -0,0 +1,12 @@ +Django<6.0,>=4.2 +psycopg2-binary>=2.9.0 + +[dev] +pytest>=7.0.0 +pytest-django>=4.5.0 +black>=22.0.0 +flake8>=4.0.0 +mypy>=0.991 + +[postgres] +psycopg2-binary>=2.9.0 diff --git a/django_translatable_fields/django_translatable_fields.egg-info/top_level.txt b/django_translatable_fields/django_translatable_fields.egg-info/top_level.txt new file mode 100644 index 0000000..8133c43 --- /dev/null +++ b/django_translatable_fields/django_translatable_fields.egg-info/top_level.txt @@ -0,0 +1,2 @@ +management +templatetags diff --git a/django_translatable_fields/fields.py b/django_translatable_fields/fields.py index f0f3133..2646f00 100644 --- a/django_translatable_fields/fields.py +++ b/django_translatable_fields/fields.py @@ -75,7 +75,7 @@ class TranslatableMixin: # Check if we're in admin context by looking at the call stack frames = inspect.getouterframes(inspect.currentframe()) - is_admin_context = any('admin' in frame.filename or 'forms' in frame.filename for frame in frames[:5]) + is_admin_context = os.environ.get('DJANGO_ADMIN_OVERRIDE', False) == '1' or any('admin' in frame.filename or 'forms' in frame.filename for frame in frames[:5]) logging.debug(f"{self.__class__.__name__} from_db_value - admin context: {is_admin_context}")