Re: Fellow Reports - March 2022

2022-03-31 Thread Mariusz Felisiak
Week ending March 27, 2022 

*Triaged: *
   https://code.djangoproject.com/ticket/33586 - Cannot delete object (A) 
referenced by another object (B) if said object (A) has a foreign key to a 
custom user. (accepted) 
   https://code.djangoproject.com/ticket/33589 - Incomplete string escaping 
in formats for calendar. (accepted) 
   https://code.djangoproject.com/ticket/33592 - view_on_site redirect does 
not work for custom admin site. (accepted) 
   https://code.djangoproject.com/ticket/33591 - Incorrect validation 
message (invalid) 
   https://code.djangoproject.com/ticket/33588 - @never_cache and 
@cache_page decorators are applied out of order for TemplateResponse. 
(accepted) 
   https://code.djangoproject.com/ticket/33593 - 
django.db.utils.InterfaceError: connection already closed (duplicate) 
   https://code.djangoproject.com/ticket/33594 - 
order_by("field1__-field2") yields inconsistent behavior (needsinfo) 
   https://code.djangoproject.com/ticket/33596 - Subsequent calls to 
prefetch_related_objects() don't work for model instances that have 
changed. (wontfix) 
   https://code.djangoproject.com/ticket/33595 - Check Constraint on 
nullable BooleanField should not be simplified (invalid) 
   https://code.djangoproject.com/ticket/33597 - Not all characters can be 
used in e-mail-addresses (duplicate) 
   https://code.djangoproject.com/ticket/33598 - Using multiple 
FilteredRelation with different filters but for same relation is ignored. 
(accepted) 
   https://code.djangoproject.com/ticket/33601 - Adding Homepage redirect 
option to Standard 404 page. (wontfix) 

*Reviewed/committed: *
   https://github.com/django/django/pull/15526 - Fixed #33592 -- Fixed 
"View on Site" links in custom admin site. 
   https://github.com/django/django/pull/15528 - Fixed #33256 -- Fixed 
schema test failures when using --keepdb. 
   https://github.com/django/django/pull/15531 - Refs #28592 -- Improved 
some headings in CSRF how-to. 
   https://github.com/django/django/pull/15532 - Refs #30581 -- Fixed 
DatabaseFeatures.bare_select_suffix on MySQL < 8 and MariaDB < 10.4. 
   https://github.com/django/django/pull/15533 - Fixed #33585 -- Made 
example git repo URLs use HTTPS protocol. 
   https://github.com/django/django/pull/15497 - Fixed #33569 -- Added 
SECURE_PROXY_SSL_HEADER support for list of protocols in the header value. 
   https://github.com/django/django/pull/15537 - Refs #32365 -- Removed 
internal uses of utils.timezone.utc alias. 
   https://github.com/django/django/pull/15483 - Fixed #7497 -- Allowed 
overriding the order of apps and models in admin. 
   https://github.com/django/django/pull/15487 - Fixed #33564 -- Confirmed 
support for PROJ 9.X. 

*Reviewed: *
   https://github.com/django/django/pull/15535 - Refs #32365 -- Made 
migration writer use datetime.timezone.utc. 

*Authored: *
   https://github.com/django/django/pull/15530 - Refs #31676 -- Used term 
"merger" instead of "committer" in docs. 
   https://github.com/django/django/pull/15538 - Refs #15619 -- Logged out 
with POST requests in admin. 
   https://github.com/django/django/pull/15539 - Refs #33577 -- Used 
addCleanup() to remove .aux file in GDALBandTests. 
   https://github.com/django/django/pull/15541 - Fixed 
forms_tests.tests.test_renderers with Jinja 3.1.0+.

Best,
Mariusz

-- 
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/a34dcef6-b659-4642-ac5b-0150ceeb1373n%40googlegroups.com.


Add minlength attribute automatically for model forms

2022-03-31 Thread Святозар Петренко
I currently have this sort of field in my model:
motivation = models.TextField(max_length=10_000, validators=[
MinLengthValidator(
100)])
And I am using CreateView with this model. The form generated by this view 
has maxlength html attribute derived from the model's max_length, and it 
makes for good UX. However there is no minlength attribute. So the user has 
to send the request and only then get the error message after the 
validation. The workaround would be something like overriding form field in 
the custom model form to specify min_length yourself or adding custom 
help_text to indirectly solve the problem, but I think it should work out 
of the box. As far as i know, the CreateView uses ModelForm, so it's a 
problem with that class rather.

Could ModelForm automatically generate form fields with minlength 
attribute, probably based on MinLengthValidator in model? Or maybe add a 
min_length attribute for model fields and use it in the same way as 
max_length, because I don't see a reason why there is max_length, but no 
min_length.

-- 
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/803a6cd3-67a8-4619-9222-ccc412799bffn%40googlegroups.com.


Revisiting MSSQL and Azure SQL Support in Django

2022-03-31 Thread Warren Chu
Hi All,

There is increasing interest within Microsoft to have stronger ties between 
Microsoft SQL Server and Django. As you may be aware, Microsoft and their 
connectivity teams have been managing the 3rd party backend for 
"mssql-django" for over a year now at: 
https://github.com/microsoft/mssql-django

Inclusion of SQL Server as a 1st party backend is viewed as a potential big 
milestone in that regard.

@adamjohnson mentioned a year ago that ideally the community would like to 
see multiple years of ongoing Microsoft support before considering merging 
as a 1st party backend.

We'd love to hear thoughts and feedback around the possibility of moving 
forward with a DEP enhancement proposal, with a commitment from Microsoft 
to providing continued dedicated support for the 1st party backend through 
the Django project itself (rather than the 3rd party repo).

Cheers,
Team Microsoft

-- 
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/0c6ca059-d50e-4c84-bef6-ab0742fc4fa9n%40googlegroups.com.


Re: Revisiting MSSQL and Azure SQL Support in Django

2022-03-31 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi again Warren,

Good work on maintaining the backend.

Merging the backend could be a good end goal, but I'd be concerned about
merging it in the current state. The README lists many features that don't
work: https://github.com/microsoft/mssql-django#limitations . This list
includes some key features like timezones, constraints, and renaming models
with foreign keys. The text also has very limited detail on the problems,
for example: "Timezones, timedeltas not fully supported" - what doesn't
work?

For comparison, the Cockroach DB backend lists its differences and
deficiencies in much more detail:
https://github.com/cockroachdb/django-cockroachdb#known-issues-and-limitations-in-cockroachdb-212x-and-earlier
. Although the list there is physically longer, the issues are much more
niche. This gives me the impression that the Cockroach DB backend has much
better feature coverage.

Merging any code into core Django significantly limits the ability to
iterate on it, given the strict release cycle. Users would have to wait for
a new Django version to get improvements. I think that whilst the MS SQL
backend is missing coverage for key features, effort would be better spent
improving it than on any merge proposal.

Adam

P.S. I still don't see Microsoft on the sponsorship page:
https://www.djangoproject.com/fundraising/ 😉


On Thu, Mar 31, 2022 at 5:30 PM Warren Chu  wrote:

> Hi All,
>
> There is increasing interest within Microsoft to have stronger ties
> between Microsoft SQL Server and Django. As you may be aware, Microsoft and
> their connectivity teams have been managing the 3rd party backend for
> "mssql-django" for over a year now at:
> https://github.com/microsoft/mssql-django
>
> Inclusion of SQL Server as a 1st party backend is viewed as a potential
> big milestone in that regard.
>
> @adamjohnson mentioned a year ago that ideally the community would like to
> see multiple years of ongoing Microsoft support before considering merging
> as a 1st party backend.
>
> We'd love to hear thoughts and feedback around the possibility of moving
> forward with a DEP enhancement proposal, with a commitment from Microsoft
> to providing continued dedicated support for the 1st party backend through
> the Django project itself (rather than the 3rd party repo).
>
> Cheers,
> Team Microsoft
>
> --
> 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/0c6ca059-d50e-4c84-bef6-ab0742fc4fa9n%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/CAMyDDM3tD428nKZRa2t9DwqT8ZsnzuHVcJiRh41R3Gd22ChSNA%40mail.gmail.com.


Re: Revisiting MSSQL and Azure SQL Support in Django

2022-03-31 Thread Warren Chu
Thanks for the feedback Adam. Your suggestions are actionable and potential 
sponsorship has been raised for discussion as recently as this week (no 
promises or strings attached).

We'll reach out to you directly if we have any direct follow-up on filling 
in the feature gaps.

 -Warren

On Thursday, 31 March 2022 at 10:07:09 UTC-7 Adam Johnson wrote:

> Hi again Warren,
>
> Good work on maintaining the backend.
>
> Merging the backend could be a good end goal, but I'd be concerned about 
> merging it in the current state. The README lists many features that don't 
> work: https://github.com/microsoft/mssql-django#limitations . This list 
> includes some key features like timezones, constraints, and renaming models 
> with foreign keys. The text also has very limited detail on the problems, 
> for example: "Timezones, timedeltas not fully supported" - what doesn't 
> work?
>
> For comparison, the Cockroach DB backend lists its differences and 
> deficiencies in much more detail: 
> https://github.com/cockroachdb/django-cockroachdb#known-issues-and-limitations-in-cockroachdb-212x-and-earlier
>  
> . Although the list there is physically longer, the issues are much more 
> niche. This gives me the impression that the Cockroach DB backend has much 
> better feature coverage.
>
> Merging any code into core Django significantly limits the ability to 
> iterate on it, given the strict release cycle. Users would have to wait for 
> a new Django version to get improvements. I think that whilst the MS SQL 
> backend is missing coverage for key features, effort would be better spent 
> improving it than on any merge proposal.
>
> Adam
>
> P.S. I still don't see Microsoft on the sponsorship page: 
> https://www.djangoproject.com/fundraising/ 😉
>
>
> On Thu, Mar 31, 2022 at 5:30 PM Warren Chu  wrote:
>
>> Hi All,
>>
>> There is increasing interest within Microsoft to have stronger ties 
>> between Microsoft SQL Server and Django. As you may be aware, Microsoft and 
>> their connectivity teams have been managing the 3rd party backend for 
>> "mssql-django" for over a year now at: 
>> https://github.com/microsoft/mssql-django
>>
>> Inclusion of SQL Server as a 1st party backend is viewed as a potential 
>> big milestone in that regard.
>>
>> @adamjohnson mentioned a year ago that ideally the community would like 
>> to see multiple years of ongoing Microsoft support before considering 
>> merging as a 1st party backend.
>>
>> We'd love to hear thoughts and feedback around the possibility of moving 
>> forward with a DEP enhancement proposal, with a commitment from Microsoft 
>> to providing continued dedicated support for the 1st party backend through 
>> the Django project itself (rather than the 3rd party repo).
>>
>> Cheers,
>> Team Microsoft
>>
>> -- 
>> 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/0c6ca059-d50e-4c84-bef6-ab0742fc4fa9n%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/b8cf251e-1719-4f9e-95ed-4f65349370b8n%40googlegroups.com.


Re: Revisiting MSSQL and Azure SQL Support in Django

2022-03-31 Thread Daryl
My 2c;

The technical board has always done a stellar job of ensuring that good
ideas end up in the code base, and unfinished, unsupported, incomplete,
young, or non-reviewed code stays outside.
The quality of the core framework, and the ease of having 3rd party code
exist as Extensions, Plug-ins and Related Libraries means that the
technical board can be -1 on a request to add code to the core framework
without negatively impacting that code's future potential. It might be a
blow to the author(s) ego, but saying "No" isn't going to make the code any
harder for end users to find, install, review, debug, and it gives the code
more time to be improved. In the future, if the code demonstrates
stability, performance and user support, maybe it gets another chance to be
merged into core.
Django's quality is, in part, a direct result of saying "No" at the right
times.

No personal disrespect intended the the authors of the MSSQL backend
package (haven't seen it, haven't used it, probably never will given the
quality of other available backends) but after spending nearly 3 decades
developing with OSS DBs and MSSQL, at times teaching design and DBA, and
having to support MS server and DB systems, Microsoft's code teams (in my
opinion) haven't shown a commitment to high quality, peer reviewed code.
Microsoft's marketing, telemetry and legal teams however have shown a very
strong commitment to put their own interests above those of the users.
This may well be a reflection of (again, my opinion) the 'profit first,
image second, quality where possible (security if we get time or negative
PR requires it)' theme that permeates MS.

Code must stand on its own merits, and no code decision should be
influenced by the reputation of the author, either negatively or
positively, but having said that, if the technical board were to decide to
include the MSSQL backend in core, there would have to be a commitment to
review every single commit from that point on, specifically looking for the
ways MS will put pressure on the codebase to bend towards the MS goals, not
the Django goals. Where the goals are the same, that is fine. I remain
skeptical that the goals are the same.

Finally, I congratulate Warren for getting the code this far.

D





On Fri, 1 Apr 2022 at 05:30, Warren Chu  wrote:

> Hi All,
>
> There is increasing interest within Microsoft to have stronger ties
> between Microsoft SQL Server and Django. As you may be aware, Microsoft and
> their connectivity teams have been managing the 3rd party backend for
> "mssql-django" for over a year now at:
> https://github.com/microsoft/mssql-django
>
> Inclusion of SQL Server as a 1st party backend is viewed as a potential
> big milestone in that regard.
>
> @adamjohnson mentioned a year ago that ideally the community would like to
> see multiple years of ongoing Microsoft support before considering merging
> as a 1st party backend.
>
> We'd love to hear thoughts and feedback around the possibility of moving
> forward with a DEP enhancement proposal, with a commitment from Microsoft
> to providing continued dedicated support for the 1st party backend through
> the Django project itself (rather than the 3rd party repo).
>
> Cheers,
> Team Microsoft
>
> --
> 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/0c6ca059-d50e-4c84-bef6-ab0742fc4fa9n%40googlegroups.com
> 
> .
>


-- 
-- 
==
Daryl Egarr,  Director
Kawhai Consultants Ltd
Cell   021 521 353
da...@kawhai.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/CALzH9qvTRkK_Q%3DFMkhAhxQaUXgd%3D%3DCjW467%2BisZJyxKrHeR5Bw%40mail.gmail.com.