Re: Removal of USE_L10N setting

2022-09-05 Thread Michael
`USE_L10N = True` breaks all my forms that have Datetime fields. The 
`value` attribute of the date inputs no longer are in the right format, and 
the POSTing the data fails. Might be worth alerting other as part of the 
release.

On Thursday, 11 August 2022 at 18:30:36 UTC+2 Michael wrote:

> Starting with version Django 5.0, with USE_L10N setting being removed, 
> will there be any way to control how date times look in the Admin site? 
> Removing this setting makes scientific/engineering applications lose a lot 
> of control in the admin interface. Say I have a field created_utc and it 
> needs to be shown in ISO format in the admin interface, how would one do 
> that with this change?
>
> On Friday, 13 August 2021 at 15:55:29 UTC+2 Uri wrote:
>
>> In my project USE_L10N = True and USE_I18N = True since the 
>> beginning (2016).
>> אורי
>> u...@speedy.net
>>
>>
>> On Fri, Aug 13, 2021 at 4:47 PM Claude Paroz  wrote:
>>
>>> I don't think I've ever set USE_L10N to True, and I've been using 
 Django in production since 0.96. 

>>>
>>> What would be most interesting to know is whether setting USE_L10N to 
>>> True would cause issues in your projects.
>>>
>>> Claude
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django developers (Contributions to Django itself)" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-develop...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-developers/7da3ed2b-8d31-4c9e-9423-c8eac33f93cfn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/55ae6713-d3f7-4eed-b787-16c370c2469en%40googlegroups.com.


Re: Removal of USE_L10N setting

2022-08-11 Thread Michael
Starting with version Django 5.0, with USE_L10N setting being removed, will 
there be any way to control how date times look in the Admin site? Removing 
this setting makes scientific/engineering applications lose a lot of 
control in the admin interface. Say I have a field created_utc and it needs 
to be shown in ISO format in the admin interface, how would one do that 
with this change?

On Friday, 13 August 2021 at 15:55:29 UTC+2 Uri wrote:

> In my project USE_L10N = True and USE_I18N = True since the 
> beginning (2016).
> אורי
> u...@speedy.net
>
>
> On Fri, Aug 13, 2021 at 4:47 PM Claude Paroz  wrote:
>
>> I don't think I've ever set USE_L10N to True, and I've been using 
>>> Django in production since 0.96. 
>>>
>>
>> What would be most interesting to know is whether setting USE_L10N to 
>> True would cause issues in your projects.
>>
>> Claude
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-develop...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/7da3ed2b-8d31-4c9e-9423-c8eac33f93cfn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c258c907-0596-40b3-b200-f454511b01c8n%40googlegroups.com.


Re: Removal of USE_L10N setting

2021-08-13 Thread אורי
In my project USE_L10N = True and USE_I18N = True since the
beginning (2016).
אורי
u...@speedy.net


On Fri, Aug 13, 2021 at 4:47 PM Claude Paroz  wrote:

> I don't think I've ever set USE_L10N to True, and I've been using
>> Django in production since 0.96.
>>
>
> What would be most interesting to know is whether setting USE_L10N to True
> would cause issues in your projects.
>
> Claude
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/7da3ed2b-8d31-4c9e-9423-c8eac33f93cfn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CABD5YeEbno%2BhWnmip92qLD-KLuz9GG61aGO0cWvDBtzba-vGCA%40mail.gmail.com.


Re: Removal of USE_L10N setting

2021-08-13 Thread Claude Paroz

>
> I don't think I've ever set USE_L10N to True, and I've been using 
> Django in production since 0.96. 
>

What would be most interesting to know is whether setting USE_L10N to True 
would cause issues in your projects.

Claude

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/7da3ed2b-8d31-4c9e-9423-c8eac33f93cfn%40googlegroups.com.


Re: Removal of USE_L10N setting

2021-08-11 Thread Hanne Moa
On Tue, 15 Jun 2021 at 12:25, Carlton Gibson  wrote:
> I have to say, I never once set `USE_L10N = False` — I don't imagine many
> people do, but my only concern would be whole swaths of folks that depend on
> this… — do such exist in numbers? 🤔

I don't think I've ever set USE_L10N to True, and I've been using
Django in production since 0.96.


HM

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CACQ%3DrrfeMzhjEg9bFUrgsCYtUKcecwV6TYLhcB_bGryAd%3DTR8g%40mail.gmail.com.


Re: Removal of USE_L10N setting

2021-06-16 Thread Jacob Rief
I in favor with René Fleschenberg's proposal to enforce localization using 
a template filter.
It happened too often, that someone forgot to unlocalize a primary key in 
their templates
causing unwanted results.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/88ec616c-0dfa-4858-b282-dcfe923572d3n%40googlegroups.com.


Re: Removal of USE_L10N setting

2021-06-16 Thread René Fleschenberg
Hi Claude,

> I understand this concern. I wonder if that could be solved separately,
> for example by:
>  - returning int subclasses from AutoField's to_python (a bit like
> str/SafeString for handling escaping)
>  - not localizing those integers, unless use_l10n is forced (True)
> Does this look like a plan (even without touching USE_L10N)?


Sounds good to me!

-- 
René

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/4a346495-ded1-5eea-6265-ab5c0378fde9%40fleschenberg.net.


Re: Removal of USE_L10N setting

2021-06-15 Thread Carlton Gibson
Hey Claude, thanks for this. 

This seems like a win to me... a nice clean-up. 

I have to say, I never once set `USE_L10N = False` — I don't imagine many
people do, but my only concern would be whole swaths of folks that depend on
this… — do such exist in numbers? 🤔

This comments seemed pertinent: 

> Le dimanche 13 juin 2021 à 01:09:26 UTC+2, re...@net a écrit :
> > I have run into bugs because template authors forgot to unlocalize 
> > values, in particular database IDs. These bugs often go unnoticed for 
> > quite a while because they only show up once you reach 1000 database 
> > rows. Forgetting to localize a value would typically be a much more 
> > obvious bug. 
> 
> I understand this concern. I wonder if that could be solved separately, 
for example by:
>  - returning int subclasses from AutoField's to_python (a bit like 
str/SafeString for handling escaping)
>  - not localizing those integers, unless use_l10n is forced (True)
> Does this look like a plan (even without touching USE_L10N)?

So we escape HTML by default, because that's the right thing to do. 

Same here, we already localize by default (in reality, because the project 
template has been that way ≈forever), again because it's the right 
behaviour. 

We `unlocalize` where that's not helpful. (But maybe there could be nicer 
API 
there.) 

Here we're just removing a whole load of codepaths for handling a unusual 
use-case. (Again, assuming it's as minority as we think). 

>From the PR: 

> ...if needed, you can simulate the
> old ``USE_L10N = False`` behavior by defining those format settings in 
your
> settings file. 
> - docs/releases/4.0.txt

Maybe we could give an example there (🤔) but there's a fallback. 

So I think +1. 

Kind Regards,

Carlton

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/97b2de49-bced-469c-9f1c-2af736be9e79n%40googlegroups.com.


Re: Removal of USE_L10N setting

2021-06-13 Thread Claude Paroz
Le dimanche 13 juin 2021 à 01:09:26 UTC+2, re...@fleschenberg.net a écrit :

> I have run into bugs because template authors forgot to unlocalize 
> values, in particular database IDs. These bugs often go unnoticed for 
> quite a while because they only show up once you reach 1000 database 
> rows. Forgetting to localize a value would typically be a much more 
> obvious bug. 
>

I understand this concern. I wonder if that could be solved separately, for 
example by:
 - returning int subclasses from AutoField's to_python (a bit like 
str/SafeString for handling escaping)
 - not localizing those integers, unless use_l10n is forced (True)
Does this look like a plan (even without touching USE_L10N)?

On 6/11/21 6:50 PM, Claude Paroz wrote: 
> > Is there a possible deprecation path? 
> Maybe add a system check that warns if the setting is still present?

Sure, the warning could suggest some tips or redirect to some part of the 
docs.

Thanks for the input.
Claude

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/cf8b1556-551c-45b0-889b-2ccf885acab3n%40googlegroups.com.


Re: Removal of USE_L10N setting

2021-06-12 Thread René Fleschenberg
Hi,

On 6/11/21 6:50 PM, Claude Paroz wrote:
> Is there a possible deprecation path?

Maybe add a system check that warns if the setting is still present?

-- 
René

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/fad2c246-f32f-6f97-d459-659b724d5abf%40fleschenberg.net.


Re: Removal of USE_L10N setting

2021-06-12 Thread René Fleschenberg
Hi,

On 6/11/21 6:50 PM, Claude Paroz wrote:
> As usual, the main drawback is backwards compatibility. The possibly
> affected projects are those having USE_L10N = False, along with multiple
> LANGUAGES.
> 
> Is this a good idea?
> I would also like to get opinions here about the compatibility issues.
> Are they acceptable?
> Is there a possible deprecation path?

I have run into bugs because template authors forgot to unlocalize
values, in particular database IDs. These bugs often go unnoticed for
quite a while because they only show up once you reach 1000 database
rows. Forgetting to localize a value would typically be a much more
obvious bug.

So far, I have always fixed these issues by adding the unlocalize
filter, though I did ponder using USE_L10N = False in the past. I don't
know how many projects there are in the wild that go with USE_L10N = False.

Personally, I believe removing the setting and **not** localizing values
unless explicitly requested would be the best option in the long run.
But I guess that would create much bigger compatibility issues.

Overall, I'm +0 on this.

-- 
René

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a3b281a1-a7c0-73b8-6d7d-6e89c7d8e50a%40fleschenberg.net.


Removal of USE_L10N setting

2021-06-11 Thread Claude Paroz

Hi,

I eventually took some time to try implementing an idea I had since some 
time: remove the USE_L10N setting.

The draft PR is here:
https://github.com/django/django/pull/14519

My motivations are:
 - one less setting
 - simplication of the code and logic regarding USE_18N/USE_L10N/USE_TZ 
settings

 - a user-friendly default behavior

As usual, the main drawback is backwards compatibility. The possibly 
affected projects are those having USE_L10N = False, along with multiple 
LANGUAGES.


Is this a good idea?
I would also like to get opinions here about the compatibility issues.
Are they acceptable?
Is there a possible deprecation path?

Regards,

Claude
--
www.2xlibre.net

--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/8cb0c69a-1900-30b4-51de-e61d6cd66a8a%402xlibre.net.