mirror of
				https://github.com/SectorLabs/django-localized-fields.git
				synced 2025-10-30 18:48:56 +03:00 
			
		
		
		
	Deprecate LocalizedFileValue.localized()
This commit is contained in:
		| @@ -1,7 +1,7 @@ | |||||||
|  | import deprecation | ||||||
| import collections | import collections | ||||||
|  |  | ||||||
| from typing import Optional | from typing import Optional | ||||||
|  |  | ||||||
| from django.conf import settings | from django.conf import settings | ||||||
| from django.utils import translation | from django.utils import translation | ||||||
|  |  | ||||||
| @@ -194,6 +194,9 @@ class LocalizedFileValue(LocalizedValue): | |||||||
|         """Returns string representation of value""" |         """Returns string representation of value""" | ||||||
|         return str(super().__str__()) |         return str(super().__str__()) | ||||||
|  |  | ||||||
|  |     @deprecation.deprecated(deprecated_in='4.6', removed_in='5.0', | ||||||
|  |                             current_version='4.6', | ||||||
|  |                             details='Use the translate() function instead.') | ||||||
|     def localized(self): |     def localized(self): | ||||||
|         """Returns value for current language""" |         """Returns value for current language""" | ||||||
|         return self.get(translation.get_language()) |         return self.get(translation.get_language()) | ||||||
|   | |||||||
| @@ -1 +1,2 @@ | |||||||
| django-postgres-extra==1.21a9 | django-postgres-extra==1.21a9 | ||||||
|  | deprecation==2.0.3 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user