Re: Probable Bug, foreign key to a database view.

2022-04-03 Thread Alexandru M.
Does it behave the way you're expecting it to behave if you declare field 
as models.CharField(max_length=4, primary_key=True)?

On Saturday, 26 March 2022 at 15:45:39 UTC+2 sandeep...@gmail.com wrote:

> class View(models.Model):
> field = models.CharField(max_length=4)
> class Meta:
>  managed=False
>   db_table = 'view' #database view
>
> class Child(models.Model):
>   view = models.ForeignKey(View, on_delete=models.CASCADE, 
> to_field='field', db_constraint=False)
>
> makemigrations on above will have the *view* field of type integer while 
> it should be varcher(4)
>
> This is my first post to the forum. Please inform if something is amiss.
>
> Thank You
>

-- 
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/a08d95ee-7707-4ef6-bf7a-df77b0b81726n%40googlegroups.com.


Re: Revisiting MSSQL and Azure SQL Support in Django

2022-04-03 Thread Florian Apolloner
Hi Tim,

On Friday, April 1, 2022 at 5:02:00 PM UTC+2 Tim Allen wrote:

> The DB popularity index at db-engines.com has regularly listed the top 
> four as Oracle, MySQL, Microsoft SQL Server, and PostgreSQL, in that order. 
> I notice some comments in this thread about Microsoft being for-profit... 
> well, what about Oracle? I don't see Oracle on the Support Django page 
> either, yet two of their databases have support in core. MSSQL is the only 
> one of the big-four RDBMS's without support in core Django. That seems to 
> be a pretty big hole in Django's offering.
>

I understand that comparing to existing databases seems like to make an 
argument for MSSQL but it is not that easy. First off, Django was released 
way earlier than Oracle acquired MySQL -- I think it is understandable that 
we do not simply drop support for a database just because Oracle buys it. 
Postgres and MySQL (or now MariaDB) are both easily installable via every 
Linux distribution and have been there since the beginning. Support for 
Oracle itself (iirc) was added because the team at that point in time 
thought it would enable Django to get access to areas where it hadn't 
access before. Oracle itself has (imo) been proven to be quite a burden 
over time and there had been discussion about removing it from core more 
than once.

Truth to be told, if the inclusion request for MSSQL gets serious we will 
have to start a discussion about whether or not we simply nuke all database 
backends (aside from sqlite maybe) from core. I'd be slightly in favor of 
simply setting a policy for core that it should only include backends of 
OSS databases. Why? Because it is way easier to install those on various 
systems than their commercial alternatives (even if there are test licenses 
and possibly free containers around there).
 

> They have put a lot of time and effort into this project, and I think 
> they're well on their way to where they need to be for the long-term goal 
> of being in core Django.


I applaud to that, but I still do not understand why a well maintained 
database backend needs to be inside core? And I am not just talking about 
database backends here, we are saying no to pretty much every library 
inclusion.
 

> A lot of the questions being asked of Microsoft in this thread just don't 
> seem fair to me - we're not asking the same of Oracle, Redis Enterprise 
> Software, or any of the other commercial products that Django has built-in 
> support for. Why Microsoft and not the others?
>

We are asking Oracle but we are also not getting far, and simply kicking it 
out is not something we do easily. As for Redis, as far as I am concerned 
(and to the extend we support it) is open source.

Cheers,
Florian

>

-- 
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/58642523-6754-4869-b85b-f065042a4e6bn%40googlegroups.com.


Re: Revisiting MSSQL and Azure SQL Support in Django

2022-04-03 Thread Tim Allen
Thanks for the thoughtful replies, and the context - I'm mostly in 
agreement, and do hope that both Oracle and Microsoft step up as corporate 
sponsors (not to mention other companies that have been sold for eight or 
nine figures).

My hope is that we can give credit where credit is due, and acknowledge 
that Microsoft has made significant strides as an open-source partner. I 
want to encourage this behavior, as I've witnessed a change since Satya 
Nadella came on board. They have made life much easier for many of us in 
the Django community. My reply was primarily due to what I perceived as 
overly-harsh comments which don't seem to reflect the current-day Microsoft.

Take care,

Tim



On Sunday, April 3, 2022 at 2:23:35 PM UTC-4 f.apo...@gmail.com wrote:

> Hi Tim,
>
> On Friday, April 1, 2022 at 5:02:00 PM UTC+2 Tim Allen wrote:
>
>> The DB popularity index at db-engines.com has regularly listed the top 
>> four as Oracle, MySQL, Microsoft SQL Server, and PostgreSQL, in that order. 
>> I notice some comments in this thread about Microsoft being for-profit... 
>> well, what about Oracle? I don't see Oracle on the Support Django page 
>> either, yet two of their databases have support in core. MSSQL is the only 
>> one of the big-four RDBMS's without support in core Django. That seems to 
>> be a pretty big hole in Django's offering.
>>
>
> I understand that comparing to existing databases seems like to make an 
> argument for MSSQL but it is not that easy. First off, Django was released 
> way earlier than Oracle acquired MySQL -- I think it is understandable that 
> we do not simply drop support for a database just because Oracle buys it. 
> Postgres and MySQL (or now MariaDB) are both easily installable via every 
> Linux distribution and have been there since the beginning. Support for 
> Oracle itself (iirc) was added because the team at that point in time 
> thought it would enable Django to get access to areas where it hadn't 
> access before. Oracle itself has (imo) been proven to be quite a burden 
> over time and there had been discussion about removing it from core more 
> than once.
>
> Truth to be told, if the inclusion request for MSSQL gets serious we will 
> have to start a discussion about whether or not we simply nuke all database 
> backends (aside from sqlite maybe) from core. I'd be slightly in favor of 
> simply setting a policy for core that it should only include backends of 
> OSS databases. Why? Because it is way easier to install those on various 
> systems than their commercial alternatives (even if there are test licenses 
> and possibly free containers around there).
>  
>
>> They have put a lot of time and effort into this project, and I think 
>> they're well on their way to where they need to be for the long-term goal 
>> of being in core Django.
>
>
> I applaud to that, but I still do not understand why a well maintained 
> database backend needs to be inside core? And I am not just talking about 
> database backends here, we are saying no to pretty much every library 
> inclusion.
>  
>
>> A lot of the questions being asked of Microsoft in this thread just don't 
>> seem fair to me - we're not asking the same of Oracle, Redis Enterprise 
>> Software, or any of the other commercial products that Django has built-in 
>> support for. Why Microsoft and not the others?
>>
>
> We are asking Oracle but we are also not getting far, and simply kicking 
> it out is not something we do easily. As for Redis, as far as I am 
> concerned (and to the extend we support it) is open source.
>
> Cheers,
> Florian
>
>>

-- 
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/efd08dee-e86f-4fef-a39a-5fb89448fc48n%40googlegroups.com.


Easy Pickings: support robust on_commit handlers

2022-04-03 Thread Josh Smeaton
I've just created a ticket for supporting robust on_commit handlers that I 
think might be a good first ticket for somebody looking to get into 
contributing to Django.

https://code.djangoproject.com/ticket/33616

I'd be more than happy to review any patch and provide guidance if 
required. It's been quite a while since I've contributed directly so I may 
not be too helpful in the "getting started" phase, but the existing 
documentation would be a good place to begin 
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/

-- 
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/d30f6430-245b-4b97-8191-9ada3ee6e2aan%40googlegroups.com.