Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-07 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Simon Charette):

 * cc: Simon Charette (removed)


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.7094aa15567560af993b4906675ac059%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-07 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 That's a pretty terrifying API.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.5c407c16ba9bbc115a6c83695fc94a23%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-06 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Simon Charette):

 * cc: Simon Charette (added)


Comment:

 I wonder if we could introduce a new filterspec API that relies on
 [https://github.com/django/django/search?utf8=%E2%9C%93&q=sticky the
 ''sticky filter'' behavior] of the ORM for this purpose instead:

 {{{#!python
 list_filters = [
 ('multi__value', StickyFilter([
 'lookup',
 ('other', SomeFilterSpect()),
 ]))
 ]
 }}}

 The `StickyFilter` (or whatever name we find for this object) would
 delegate filtering and rendering to its underlying filters but make sure
 to mark the `queryset` object passed to it as having ''sticky'' filters
 (aliases are reused when a queryset is sticky) before calling each of its
 filters `queryset(request, sticky_queryset)` methods.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.36d4ad88923fcd96cf88c5259e42aef3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-06 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham):

 I'm not sure if I agree with Josh's feeling that someone is relying on
 this. I'd lean toward calling the current behavior a bug and just fixing
 it, if possible. I guess using list filter's across multiple relations to
 the same model might not be very common which is why this didn't surface
 until now.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.be4f2f6ccf848c6728db78f76d9e7ea3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-06 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 Oh well yes you had mentioned you wanted this to be backwards compatible
 or choosable. If people agreed that the proposed behavior is preferable
 then that option could go away after a deprecation schedule. The issue
 gets a few elaborate notices in the docs so it stands to reason an API
 option on this subject would at least have some reference material to back
 it up.

 As for that other ticket, this patch would provide a few hooks for people
 to apply their Qs in complex ways. I think that simply attaching an AND or
 OR to each would quickly become too simplistic for most authors.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.3a079cb7a27360438519c3dedd9b3a40%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-06 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham):

 I think all the documented `ModelAdmin` attributes are relatively straight
 forward. `Q` is a Django ORM thing and if I didn't follow this ticket, I
 don't think it would be  at all obvious or intuitive what
 `filter_q_behavior` might mean or what effect it might have (maybe the
 idea is fine and only a better name is needed). Maybe you'd like to try
 the DevelopersMailingList to get some other input.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.3ce1310e2fe052e63e3c63ca152116a2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-06 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 The problem with an approach like that is that this is only superficially
 like an OR, but it's still an AND.

 Can you explain what you mean a little more by exposing internals?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.f50ed0153b2c19b0d6c269b6f80f346e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-06 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham):

 Sorry, I had some trouble understanding the issue -- I guess the sample I
 was looking at didn't demonstrate the issue at first.

 I'm not sure about the best way to resolve it. The
 [https://github.com/django/django/pull/7345 proposed]
 `ModelAdmin.filter_q_behavior` attribute seems to expose internals of
 Django's ORM too much. Maybe trying to frame the solution as allowing a
 way for the admin user or the `ModelAdmin` author to choose between AND
 and OR in the filter criteria as proposed in #18736 would be simpler for
 everyone to understand.

 Tests might be in `tests/admin_filters/` or some of the other `admin_*`
 test packages.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.138b1e8b0456fabe6c775a2adf5bd526%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-05 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 I kept my patch intentionally simple and didn't try to solve any of those
 other cases, but if there is some current wishlist or related tickets I
 can consider them in a patch and move forward. But I think a greater
 design decision should be made about this issue, though, because
 regardless of the past I don't think that leaving the logical OR is
 consistent or even intentionally used or realized by most implementors.
 The filter().filter() issue is something that trips up even more
 experienced Djangonauts.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.d263feed443594e4c5124fb813c86ede%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Josh Smeaton):

 In that case, I tentatively agree that targeting a single join is
 *usually* what you want. But having some way to make this decision is even
 better. I admit I don't really follow the patch that well, but some test
 cases might make your change more clear. Are you able to provide test
 cases that allow users to target a single join or chain to multiple? By
 users, I really mean admin developers.

 Or does your change implement targeting a single join, only, allowing no
 customisation? If so, even though it's arguably a better design, it's a
 backwards incompatibility that someone is certainly relying on.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.701b0a0b7d627a4cc9ec8c98e06cbcf9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 Yes.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.258d39ced9a0a395d91b31e899403eba%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Josh Smeaton):

 I think I understand the point you're trying to make Steve. Do the docs
 here represent the different behaviours you're trying to put across?
 https://docs.djangoproject.com/en/1.10/topics/db/queries/#spanning-multi-
 valued-relationships

 Those docs primarily refer to multi-value relationships which I'm not
 certain is the use case you're trying to resolve. But to summarise:

 `.filter(multi__value__lookup=1, multi__value__other=2)` is equivalent to
 `(MVL=1 AND MVO=2)` because the WHERE clause targets a single join.

 {{{
 SELECT * FROM model
 JOIN multi ON model.multi_id = multi.id
 JOIN value on multi.value_id = value.id
 WHERE value.MVL=1 AND value.MVO = 2
 }}}

 Where `.filter(multi__value__lookup=1).filter(multi__value__other=2)` is
 logically equivalent to `(MVL=1 OR MVO=2)` because MVL and MVO have
 separate joins, so they can both match independently since it's a
 multivalue relationship.

 {{{
 SELECT * FROM model
 JOIN multi ON model.multi_id = multi.id
 JOIN value on multi.value_id = value.id
 JOIN multi m2 ON model.multi_id = m2.id
 JOIN value v2 on multi.value_id = v2.id
 WHERE value.MVL=1 AND v2.MVO = 2
 }}}

 Does this correctly summarise the behaviour?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.3d64818189dee408c2f8b2a017f395ba%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham):

 I didn't see the fixtures in your sample project until a few comments ago.
 Using that data, could you give sample selected filters and the expected
 vs. actual results?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.d720b4e415122e408c982bf73f039e66%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 (Although while we are on that subject I could see many ways forward for
 features related to OR filtering if FilterSpecs used Q objects instead of
 chained filters)

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.7c20f4b7015cd93f47bf6c51c5c909e7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 I'm not really sure how you arrive at my usage being OR. In the case I am
 trying to describe, I still want all conditions to be true. But I want the
 application of those conditions to happen on one single join instead of
 separate joins. That is still SQL AND.

 The proof is in the pudding, here is a link to the line number in my
 sample patch where I am applying a SQL AND
 
https://github.com/yeago/django-1/commit/bccabbfcf443f0fac511599ccfdf166bb1697b6b
 #diff-ea7d8c684e252f3dad6aa458df7d3070R329

 Hopefully with this we can set aside discussion of OR vs AND.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.c3b9311e3faf809641d918f1da5e9ea8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham):

 I'm trying to use AND and OR as they work in SQL:

 The AND operator displays a record if both the first condition AND the
 second condition are true.
 The OR operator displays a record if either the first condition OR the
 second condition is true.

 It seems like your usage of AND is the SQL OR. Rather than the second list
 filter criteria narrowing down the results of the first list filter
 criteria, you want to see objects that match all of the list filters that
 are selected. Is that correct?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.9842c7729d605f2a58971034b61eba42%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 I think that its likely we still are not understanding each other. In my
 case above, its not OR, its AND. The only difference is that the filters
 are applied to the same join versus creating additional joins for each
 filtered field. I think its probably much more likely that ordinary users
 would expect things to behave as I am suggesting rather than how they are.
 I don't think anyone would want to filter on a list of hypothetical Info
 objects, and then filter them by user, and then filter them by date, and
 still be confronted by objects that do not reflect querying of user AND
 date.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.bc8c8511710bfc2f5739b5b3a7c07f39%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham):

 It sounds like you want list filter's to work using OR then? I guess that
 could be a duplicate of #18736. It seems problematic to implement your
 proposal without a corresponding UI change as a user wouldn't have any way
 to know whether AND or OR are in use. What do you think?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.d42e2407b544459ed9fe61bdfe2f5cfd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 Well the case I am attempting to satisfy here is when you want a list of
 infos by that person and this month.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.eb44cf6ab18ad8e8951fa61e3e4b04c9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham):

 Sorry, I'm still not understanding. After selecting "This month" and
 "person 2" in the admin filters for the info page, I see the query:
 {{{
 SELECT "app_info"."id", "app_info"."name"
 FROM "app_info"
 INNER JOIN "app_contact" ON ("app_info"."id" = "app_contact"."info_id")
 INNER JOIN "app_contact" T3 ON ("app_info"."id" = T3."info_id")
 WHERE ("app_contact"."date" < 2016-11-01 00:00:00 AND "app_contact"."date"
 >= 2016-10-01 00:00:00 AND T3."person_id" = 2)
 }}}
 It seems to give the expected results of infos that have contacts with
 person=2 AND date=this month. Please let me know my mistake.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.3602fd1974bfc22f3dc6e5e9b5e9652f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 Its the same as opening a shell and doing

 {{{
 AnyModel.objects.filter(any__join_field2='X').filter(any__join_field2='Y')
 }}}

 vs
 {{{
 AnyModel.objects.filter(field2='X').filter(field2='Y')
 }}}

 If you look at the sample project and attempt to filter Info objects of
 person X within a date Y, you can't.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.df02ba2ab73a3812bc83dd0dade55ff3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by steve yeago):

 https://github.com/yeago/qfilter-problem

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.a147a9f879b46fa73b727003742a1250%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-04 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham):

 Could you give a sample project that demonstrates this issue?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.8ed2226abb787e7ae9a9fda064ca79b3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27303: Allow FilterSpecs to return Q-likes

2016-10-01 Thread Django
#27303: Allow FilterSpecs to return Q-likes
---+--
 Reporter:  Yeago  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 Severity:  Normal |   Resolution:
 Keywords:  filterspec | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Yeago):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 One note is that this method won't play well with the current "naked"
 approach to adding "some__relation" to list_display. Perhaps the implicit
 filters (such as django.contrib.admin.filters.RelatedFieldListFilter)
 could return a Q instead of a chained filter().

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.0d5486f4adb80042a266a9eb138aaaed%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.