Re: More eyes on Check Constraints

2017-09-10 Thread Aymeric Augustin
Hello,

I reviewed the PR today — better late than never... It's looking good and it 
would be a great addition to Django 2.0.

The biggest outstanding problem is code duplication in 
django.db.models.sql.query. Advice from people who know a bit about this module 
would help a lot. Search for "It may be possible to simplify this further." on 
https://github.com/django/django/pull/7615 
 and read from there.

Thanks!

-- 
Aymeric.



> On 10 Aug 2017, at 20:12, Ian Foote  wrote:
> 
> Hi all,
> 
> I've been working on https://code.djangoproject.com/ticket/11964 to add 
> support for Check Constraints to the Django ORM and migrations framework. My 
> work can be found at https://github.com/django/django/pull/7615.
> 
> I think the functionality is basically there, so what it really needs is some 
> testing on real-world use-cases and more eyes to suggest any further 
> simplifications or improvements that may be possible.
> 
> Thanks,
> 
> Ian
> 
> -- 
> 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 post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/58b62be6-7eb1-2b20-3940-1394aa9e39dd%40feete.org.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/E76B6F76-C4B6-4A58-8206-56C0F53ECD8D%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.


Re: Having a MongoDB connector for Django

2017-09-10 Thread Adam Johnson
>
> That's a bit ridiculous, because now I have to reinvent Django ORM,
> contrib packages and everything under the sun.



> Django can work with DBs that support or don't support transactions.


I don't know where you get the impression that Django can work with
transactionless DB's from. Many of Django's features assume transactional
support, e.g. the ORM features update(), delete(), get_or_create(),
many-to-many fields, etc. By extension I think the contrib packages all
rely on them in some way.

On 10 September 2017 at 06:30, Nes Dis  wrote:

> If I can summarize the different thoughts for having a Django connector
> for nosql db like Mongodb:
>
>
>1.  Don't mix up  relational database with a document store database
>- Document store DBs also have syntax for performing relation lookups
>   within them. Possibly complex relational operations are not supported 
> but
>   lookups from one table/collection to another is possible
>2. Use a completely new wrapper to deal with non-rel DBs
>   - That's a bit ridiculous, because now I have to reinvent Django
>   ORM, contrib packages and everything under the sun.
>3. Use 2 DBs one for contrib packages other for website specific data.
>   - Managing 2 DBs is a troublesome marriage.
>4. Translating SQL to Mongodb syntax is not easy/ Impossible.
>   - It's not easy, but has been done: djongo
>   . SQL DBs have a lot of features,
>   SQLite has very few, Django can work with DBs that support or don't 
> support
>   transactions.
>
> Does it matter to the end user, what the underlying DB really is? By
> adding support for other DBs into Django, it's accessible to larger user
> base.
>
> On Friday, 8 September 2017 18:33:59 UTC+5:30, Nes Dis wrote:
>>
>> Hello
>>
>> I am wondering what is the state of the art on Django having a backend
>> connector for MongoDB database backend. There are a few solutions out there
>> but they don't work as expected.
>>
>> A possible solution for this is to have a connector which translates SQL
>> queries created in Django, into MongoDB queries.
>>
>> I would like to hear the *expert opinion *from the esteemed members of
>> this group on this concept.
>>
>> A working solution for this can be found here: djongo
>> . (Django + Mongo = Djongo) The
>> project is hosted on github.
>>
>> Regards
>> Nes Dis
>>
> --
> 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 post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/4826023b-c697-4a0e-b43d-
> 476ad9927673%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM3QXvSC9TVeN19KoaOAnmwFmUGjti3KRptr9PE%3DkcRNfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Having a MongoDB connector for Django

2017-09-10 Thread Aymeric Augustin
Hello,

This discussions seems to have started with a misunderstanding of what Django 
is.

Here's a very incomplete list (in advance, apologies to everyone for everything 
that I'm inevitably going to omit)

1. The Django community
1.a. Django Girls
1.b. Conferences, events
1.c. Processes for keeping the community healthy
1.d. Mailing lists, blogs, SO
etc.

2. The Django ecosystem
2.a. Third party apps
2.b. Books
2.c. Hosting services
2.d. Consulting services
etc.

3. The Django framework
See https://docs.djangoproject.com/en/1.11/ 
 — I'm not going to repeat it all; the 
ORM is just one of many parts.

Some choices are necessary to keep all this manageable. "We focus on building 
apps on top of SQL databases" is one of these choices.

The starting point of the discussion was "I'm using MongoDB". Well, this means 
Django isn't designed to handle your situation. Perhaps you can use it, but you 
aren't going to get the full benefits.

One of the tradeoffs that you (or someone else) made by picking MongoDB is that 
you can't use much of the Django ecosystem. You can still use the view and 
template layers and about half of forms. You can't use the ORM nor anything 
that depends on it.

At this time, I don't know many people actively involved in Django who thinks 
it's reasonable and useful to expand the ORM to support MongoDB.

The consensus about "reasonable" is a steady "no". See discussions in the 
archives of this mailing list or take a closer look at the ORM to understand 
why.

I think there's a debate aboute "useful". Some people run (or have run) Django 
on top of MongoDB with various third-party connectors but I haven't heard 
success stories. (I'd be interested in hearing such stories.)

I see only one way for this situation to change: if someone builds a robust 
MongoDB backend that works well enough in practice and if it becomes vastly 
successful. Perhaps that's djongo. There are technical reasons to believe this 
won't happen, though.

I hope this helps.

-- 
Aymeric.

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/6FBFA945-9378-4A29-BD1B-83B7930492E5%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.


Re: #21381 PR review needed

2017-09-10 Thread dspechnikov
I've finished the whole thing. Waiting for the review to push it to RFC 
stage. Thanks to anyone who will have time to help with it.

On Tuesday, September 5, 2017 at 9:33:29 PM UTC+3, dspec...@gmail.com wrote:
>
> I've completed code and tests and would like to have someone review it 
> before I'll start working on documentation.
>
> PR 
> Ticket 
>
> Thanks in advance.
>

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/3d60f020-a2fb-4b98-bdb5-07bd1f751382%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


What's the community position about AutoSlugField functionality in Django?

2017-09-10 Thread dspechnikov
Basically, subj.

I use this functionality myself a lot and don't wanna having to implement 
it as 3rd-party app anymore. 

I found ticket #12651 , but it 
seems to be forgotten. I'd like to start working on it, but want to make 
sure it is still acceptable officially.

Suggestion on implementation details are welcome too (concerns about DB 
load, etc.).

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/237d70f9-4b36-42f0-aede-10335a1b532e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Question on documentation (new contributor)

2017-09-10 Thread Israel Fermin Montilla

Hello guys!

I'm a new guy who wants to help and contribute to Django.

I'm taking care of this ticket 
https://code.djangoproject.com/ticket/28539, it has to do with 
documentation, the person who submitted it added a patch already.


He added some documentation to the Remote User Authentication page 
(https://docs.djangoproject.com/en/1.11/howto/auth-remote-user/) 
mentioning that the custom request header `REMOTE_USER` needs to 
actually be `Remote-User` because of what's mentioned here: 
https://github.com/django/django/blob/ad524980ac9644d5d40c2c79af3c183f4351841e/docs/ref/request-response.txt#L164


I think it is a valid suggestion as I've seen a lot of people struggle 
with this when testing their stuff. But I'm not sure if it's well 
written, according to the docs on Writing Documentation 
(https://docs.djangoproject.com/en/dev/internals/contributing/writing-documentation/) 
it looks ok to me though.


Any advise on how to proceed with this one?

--
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/802907a1-2fc3-980f-c8d4-51f78c38017f%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Having a MongoDB connector for Django

2017-09-10 Thread Shai Berger
I would like to add to this discussion just the clarification that, when we say 
Django relies on transactions, we don't mean that it is impossible to write a 
database backend which doesn't implement them -- but that Django assumes 
transactional behavior to protect data integrity. It can work without 
transactions, for a very superficial definition of "work", but that operation 
will be prone to horrible race conditions and data losses. Similar disclaimers 
are valid for several other relational features.

Shai.


Re: Having a MongoDB connector for Django

2017-09-10 Thread Nes Dis
Thank you all for your very insightful comments. I personally am a big 
user/contributor to the framework myself and would like to see it thrive 
and progress with respect to other competing frameworks.

I am sure most are aware, of this argument about MongoDB increasing in 
popularity. Several members are of the opinion that not supporting this 
backend (which in my opinion is not too difficult) will not dent Django's 
popularity. 

In conclusion, I do hope this is the right decision for Django will take it 
in the correct direction!

Regards
Nesdis



On Friday, 8 September 2017 18:33:59 UTC+5:30, Nes Dis wrote:
>
> Hello
>
> I am wondering what is the state of the art on Django having a backend 
> connector for MongoDB database backend. There are a few solutions out there 
> but they don't work as expected. 
>
> A possible solution for this is to have a connector which translates SQL 
> queries created in Django, into MongoDB queries.
>
> I would like to hear the *expert opinion *from the esteemed members of 
> this group on this concept.
>
> A working solution for this can be found here: djongo 
> . (Django + Mongo = Djongo) The project 
> is hosted on github.
>
> Regards
> Nes Dis
>

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/00ea22fe-a58f-4427-93fb-2644682b5873%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ticket #28384 question

2017-09-10 Thread Windson Yang
Any suggestions? Or I miss something here?

在 2017年9月7日星期四 UTC+8下午2:25:12,Windson Yang写道:
>
> This problem actually in
>
> option.py 
> 
>  
> if not prev_field or (prev_field.is_relation and
>   field not in prev_field.get_path_info
> ()[-1].target_fields):
> relation_parts.append(part)
> and 
>
> related.py 
> 
>  def get_path_info(self):
> to_opts = self.remote_field.model._meta
> from_opts = self.model._meta
> return [PathInfo(from_opts, to_opts, (to_opts.pk,), self, False, False
> )]
>
>
> # It is allowed to filter on values that would be found from 
> local
> # model anyways. For example, if you filter on 
> employee__department__id,
> # then the id value would be found already from 
> employee__department_id.
>
> I'm not sure in this situation, should we change the target_field so let 
> it only focus on xxx_id instead of pk? Or we just add a condition in 
> option.py  to check xxx_id or not?
>

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d8c46bec-eb0f-4342-91ef-7ad95dce45fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.