#24930: Add generic archive views for objects with DateRangeFields
-------------------------------+--------------------------------------
     Reporter:  underyx        |                    Owner:  nobody
         Type:  New feature    |                   Status:  closed
    Component:  Generic views  |                  Version:  master
     Severity:  Normal         |               Resolution:  wontfix
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by mjtamlyn):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 The behaviour of this would have several possible options, and I don't
 think it's a generic enough use case to deserve Django maintaining it.
 What happens when the range spans two months/years? Does it appear in
 both? Only one? If one based on what, start? end?

 As a side note, I *think*, though I'm not completely sure, that the
 existing archive views can be used in the "only one" case by:

 - Setting `date_field = 'range__start'`
 - Overriding `uses_datetimefield` if you are using a `DateTimeRangeField`
 - Overriding `ordering` until such a time as transforms are supported in
 order by clauses (hopefully forthcoming).

 For the "overlaps" case, a lot more work would be needed. At present the
 implementation of the archive views assumes a fixed point in time, and
 that every object would appear in only one view. For example, getting the
 list of possible sub views (month views for a year) which are non empty is
 a much harder process.

 So, one possible use case is (nearly) covered by the built in view. The
 second is largely different, but could definitely live in a third party
 package. I'd rather keep contrib.postgres for database things and their
 form fields rather than adding any possible related concept.

--
Ticket URL: <https://code.djangoproject.com/ticket/24930#comment:4>
Django <https://code.djangoproject.com/>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.be000cdfadb68fc0dede388370075539%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to