mirror of
				https://github.com/SectorLabs/django-localized-fields.git
				synced 2025-10-25 00:28:57 +03:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 893fe0f5ab | ||
|  | 3de1492a58 | ||
|  | 946e9a67c4 | ||
|  | 36f6e946b0 | 
| @@ -17,17 +17,17 @@ class LocalizedAutoSlugField(LocalizedField): | ||||
|     """Automatically provides slugs for a localized | ||||
|     field upon saving.""" | ||||
|  | ||||
|     warnings.warn( | ||||
|         'LocalizedAutoSlug is deprecated and will be removed in the next major version.', | ||||
|         DeprecationWarning | ||||
|     ) | ||||
|  | ||||
|     def __init__(self, *args, **kwargs): | ||||
|         """Initializes a new instance of :see:LocalizedAutoSlugField.""" | ||||
|  | ||||
|         self.populate_from = kwargs.pop('populate_from', None) | ||||
|         self.include_time = kwargs.pop('include_time', False) | ||||
|  | ||||
|         warnings.warn( | ||||
|             'LocalizedAutoSlug is deprecated and will be removed in the next major version.', | ||||
|             DeprecationWarning | ||||
|         ) | ||||
|  | ||||
|         super(LocalizedAutoSlugField, self).__init__( | ||||
|             *args, | ||||
|             **kwargs | ||||
|   | ||||
| @@ -1,7 +1,8 @@ | ||||
| import deprecation | ||||
| import collections | ||||
|  | ||||
| from typing import Optional | ||||
| from collections.abc import Iterable | ||||
|  | ||||
| from django.conf import settings | ||||
| from django.utils import translation | ||||
|  | ||||
| @@ -97,7 +98,7 @@ class LocalizedValue(dict): | ||||
|                 lang_value = value.get(lang_code, self.default_value) | ||||
|                 self.set(lang_code, lang_value) | ||||
|  | ||||
|         elif isinstance(value, collections.Iterable): | ||||
|         elif isinstance(value, Iterable): | ||||
|             for val in value: | ||||
|                 self._interpret_value(val) | ||||
|  | ||||
|   | ||||
| @@ -1,2 +1,2 @@ | ||||
| django-postgres-extra==1.21a9 | ||||
| django-postgres-extra==1.22 | ||||
| deprecation==2.0.3 | ||||
|   | ||||
							
								
								
									
										23
									
								
								settings.py
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								settings.py
									
									
									
									
									
								
							| @@ -24,10 +24,33 @@ INSTALLED_APPS = ( | ||||
|     'django.contrib.auth', | ||||
|     'django.contrib.contenttypes', | ||||
|     'django.contrib.admin', | ||||
|     'django.contrib.messages', | ||||
|     'localized_fields', | ||||
|     'tests', | ||||
| ) | ||||
|  | ||||
| TEMPLATES = [ | ||||
|     { | ||||
|         "BACKEND": "django.template.backends.django.DjangoTemplates", | ||||
|         "DIRS": [], | ||||
|         "APP_DIRS": True, | ||||
|         "OPTIONS": { | ||||
|             "context_processors": [ | ||||
|                 "django.template.context_processors.debug", | ||||
|                 "django.template.context_processors.request", | ||||
|                 "django.contrib.auth.context_processors.auth", | ||||
|                 "django.contrib.messages.context_processors.messages", | ||||
|             ], | ||||
|         }, | ||||
|     }, | ||||
| ] | ||||
|  | ||||
| MIDDLEWARE = [ | ||||
|     'django.contrib.messages.middleware.MessageMiddleware', | ||||
|     'django.contrib.sessions.middleware.SessionMiddleware', | ||||
|     'django.contrib.auth.middleware.AuthenticationMiddleware', | ||||
| ] | ||||
|  | ||||
| # set to a lower number than the default, since | ||||
| # we want the tests to be fast, default is 100 | ||||
| LOCALIZED_FIELDS_MAX_RETRIES = 3 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user