+
    Tj)i              	       |   ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ R	IHt ^ R
IHtHt ^ RIHtHt  ! R R4      t ! R R4      t ! R R4      t ! R R4      t ! R R4      t ! R R]]]4      t ! R R]4      t ! R R]]4      t ! R R]]4      t  ! R R]] 4      t! ! R  R!]]]4      t" ! R" R#]]"4      t# ! R$ R%]]]4      t$ ! R& R']]$4      t% ! R( R)]]]]4      t& ! R* R+]]&4      t' ! R, R-]&4      t( ! R. R/]](4      t) ! R0 R1]]]]]4      t* ! R2 R3]]*4      t+R7R4 lt,R5 t-R6 t.R# )8    N)settings)ImproperlyConfigured)models)Http404)timezone)cached_property)gettext)View)BaseDetailView!SingleObjectTemplateResponseMixin)MultipleObjectMixin#MultipleObjectTemplateResponseMixinc                   P   a  ] tR t^t o RtRtRtR tR tR t	R t
R tR	 tR
tV tR# )	YearMixinz-Mixin for views manipulating year-based data.z%YNc                    V P                   # )z^
Get a year format string in strptime syntax to be used to parse the
year from url variables.
)year_formatselfs   &O/var/www/idalgo/venv/lib/python3.14/site-packages/django/views/generic/dates.pyget_year_formatYearMixin.get_year_format       
     c                    V P                   pVf    V P                  R,          pV# V#   \         dF     T P                  P                  R,          p T#   \         d    \        \        R4      4      hi ; ii ; i)z8Return the year for which this view should display data.yearzNo year specified)r   kwargsKeyErrorrequestGETr   _)r   r   s   & r   get_yearYearMixin.get_year"       yy<:{{6* t  ::<<++F3D    :!!$7"899::   ) A9A A55A9c                    \        WRRR7      # )zGet the next valid year.Fr   is_previousperiod_get_next_prevr   dates   &&r   get_next_yearYearMixin.get_next_year/       deFKKr   c                    \        WRRR7      # )zGet the previous valid year.Tr   r&   r)   r+   s   &&r   get_previous_yearYearMixin.get_previous_year3       dd6JJr   c                     VP                  VP                  ^,           ^^R7      #   \         d    \        \	        R4      4      hi ; i)t
Return the start date of the next interval.

The interval is defined by start date <= item date < next start date.
r   monthdayDate out of range)replacer   
ValueErrorr   r    r+   s   &&r   _get_next_yearYearMixin._get_next_year7   sD    	2<<TYY]!<CC 	2!/011	2s	   $'  Ac                (    VP                  ^^R7      # ).Return the start date of the current interval.r7   r8   r:   r+   s   &&r   _get_current_yearYearMixin._get_current_yearB   s    ||!|++r    )__name__
__module____qualname____firstlineno____doc__r   r   r   r!   r-   r1   r<   rB   __static_attributes____classdictcell____classdict__s   @r   r   r      s7     7KD LK	2, ,r   r   c                   P   a  ] tR t^Gt o RtRtRtR tR tR t	R t
R tR	 tR
tV tR# )
MonthMixinz.Mixin for views manipulating month-based data.z%bNc                    V P                   # )z`
Get a month format string in strptime syntax to be used to parse the
month from url variables.
)month_formatr   s   &r   get_month_formatMonthMixin.get_month_formatM       
    r   c                    V P                   pVf    V P                  R,          pV# V#   \         dF     T P                  P                  R,          p T#   \         d    \        \        R4      4      hi ; ii ; i)z9Return the month for which this view should display data.r7   zNo month specified)r7   r   r   r   r   r   r    )r   r7   s   & r   	get_monthMonthMixin.get_monthT   s    

=;G, u  ;; LL,,W5E    ;!!$8"9::;;r$   c                    \        WRRR7      # )zGet the next valid month.Fr7   r&   r)   r+   s   &&r   get_next_monthMonthMixin.get_next_montha   s    deGLLr   c                    \        WRRR7      # )zGet the previous valid month.Tr7   r&   r)   r+   s   &&r   get_previous_monthMonthMixin.get_previous_monthe   s    dd7KKr   c                    VP                   ^8X  d'    VP                  VP                  ^,           ^^R7      # VP                  VP                   ^,           ^R7      #   \         d    \	        \        R4      4      hi ; i)r5   r6   r9   r@   )r7   r:   r   r;   r   r    r+   s   &&r   _get_next_monthMonthMixin._get_next_monthi   sq     ::6||QaQ|GG <<djj1n!<<<  6a 34556s   $A  A<c                &    VP                  ^R7      # )z/Return the start date of the previous interval.)r8   rA   r+   s   &&r   _get_current_monthMonthMixin._get_current_monthw   s    |||""r   rD   )rE   rF   rG   rH   rI   rQ   r7   rR   rV   rY   r\   r_   rb   rJ   rK   rL   s   @r   rO   rO   G   s7     8LE!ML=# #r   rO   c                   P   a  ] tR t^|t o RtRtRtR tR tR t	R t
R tR	 tR
tV tR# )DayMixinz,Mixin for views manipulating day-based data.z%dNc                    V P                   # )z\
Get a day format string in strptime syntax to be used to parse the day
from url variables.
)
day_formatr   s   &r   get_day_formatDayMixin.get_day_format   s    
 r   c                    V P                   pVf    V P                  R,          pV# V#   \         dF     T P                  P                  R,          p T#   \         d    \        \        R4      4      hi ; ii ; i)z7Return the day for which this view should display data.r8   zNo day specified)r8   r   r   r   r   r   r    )r   r8   s   & r   get_dayDayMixin.get_day   s    hh;9kk%( 
s
  99,,**51C 
   9!!$6"78899r$   c                    \        WRRR7      # )zGet the next valid day.Fr8   r&   r)   r+   s   &&r   get_next_dayDayMixin.get_next_day   s    deEJJr   c                    \        WRRR7      # )zGet the previous valid day.Tr8   r&   r)   r+   s   &&r   get_previous_dayDayMixin.get_previous_day   s    dd5IIr   c                >    V\         P                  ! ^R7      ,           # )r5   days)datetime	timedeltar+   s   &&r   _get_next_dayDayMixin._get_next_day   s     h((a000r   c                    V# r?   rD   r+   s   &&r   _get_current_dayDayMixin._get_current_day   s    r   rD   )rE   rF   rG   rH   rI   rg   r8   rh   rk   rn   rq   rx   r|   rJ   rK   rL   s   @r   re   re   |   s7     6J
CKJ1 r   re   c                   V   a  ] tR t^t o RtRtRtR tR tR t	R t
R tR	 tR
 tRtV tR# )	WeekMixinz-Mixin for views manipulating week-based data.%UNc                    V P                   # )z^
Get a week format string in strptime syntax to be used to parse the
week from url variables.
)week_formatr   s   &r   get_week_formatWeekMixin.get_week_format   r   r   c                    V P                   pVf    V P                  R,          pV# V#   \         dF     T P                  P                  R,          p T#   \         d    \        \        R4      4      hi ; ii ; i)z8Return the week for which this view should display data.weekzNo week specified)r   r   r   r   r   r   r    )r   r   s   & r   get_weekWeekMixin.get_week   r#   r$   c                    \        WRRR7      # )zGet the next valid week.Fr   r&   r)   r+   s   &&r   get_next_weekWeekMixin.get_next_week   r/   r   c                    \        WRRR7      # )zGet the previous valid week.Tr   r&   r)   r+   s   &&r   get_previous_weekWeekMixin.get_previous_week   r3   r   c                     V\         P                  ! ^V P                  V4      ,
          R7      ,           #   \         d    \	        \        R4      4      hi ; i)r5   rt   r9   )rv   rw   _get_weekdayOverflowErrorr   r    r+   s   &&r   _get_next_weekWeekMixin._get_next_week   sM    	2(,,!d6G6G6M2MNNN 	2!/011	2s	   36  Ac                Z    V\         P                  ! V P                  V4      4      ,
          # r{   )rv   rw   r   r+   s   &&r   _get_current_weekWeekMixin._get_current_week   s#    h(():):4)@AAAr   c                    V P                  4       pVR9   d   VP                  4       # VR8X  d   VP                  4       ^,           ^,          # \        RV,          4      h)zn
Return the weekday for a given date.

The first day according to the week format is 0 and the last day is 6.
r   zunknown week format: %s>   %V%W)r   weekdayr;   )r   r,   r   s   && r   r   WeekMixin._get_weekday   sU     **,,&<<>!D LLNQ&!++6DEEr   rD   )rE   rF   rG   rH   rI   r   r   r   r   r   r   r   r   r   rJ   rK   rL   s   @r   r   r      s?     7KD LK	2BF Fr   r   c                   T   a  ] tR t^t o RtRtRtR tR t]	R 4       t
R tR tR	tV tR# )
	DateMixinz3Mixin class for views manipulating date-based data.NFc                    V P                   f'   \        RV P                  P                  ,          4      hV P                   # )z7Get the name of the date field to be used to filter by.z%s.date_field is required.)
date_fieldr   	__class__rE   r   s   &r   get_date_fieldDateMixin.get_date_field   s7    ??"&,t~~/F/FF  r   c                    V P                   # )zQ
Return `True` if the view should be allowed to display objects from
the future.
)allow_futurer   s   &r   get_allow_futureDateMixin.get_allow_future   rT   r   c                    V P                   f   V P                  4       P                   MV P                   pVP                  P                  V P	                  4       4      p\        V\        P                  4      # )zY
Return `True` if the date field is a `DateTimeField` and `False`
if it's a `DateField`.
)modelget_queryset_meta	get_fieldr   
isinstancer   DateTimeField)r   r   fields   &  r   uses_datetime_fieldDateMixin.uses_datetime_field  sW     .2ZZ-?!!#))TZZ%%d&9&9&;<%!5!566r   c                    V P                   '       de   \        P                  P                  V\        P                  P                  4      p\
        P                  '       d   \        P                  ! V4      pV# )z
Convert a date into a datetime when the date field is a DateTimeField.

When time zone support is enabled, `date` is assumed to be in the
current time zone, so that displayed items are consistent with the URL.
)	r   rv   combinetimeminr   USE_TZr   
make_aware)r   values   &&r   _make_date_lookup_argDateMixin._make_date_lookup_arg  sP     ###%%--eX]]5F5FGE ++E2r   c                    V P                  4       pV P                  '       dS   V P                  V4      pV P                  V\        P                  ! ^R7      ,           4      pRV,          VRV,          V/# W!/# )z
Get the lookup kwargs for filtering on a single date.

If the date field is a DateTimeField, we can't just filter on
date_field=date because that doesn't take the time into account.
rt   %s__gte%s__lt)r   r   r   rv   rw   )r   r,   r   sinceuntils   &&   r   _make_single_date_lookup"DateMixin._make_single_date_lookup  sw     ((*
###..t4E..th6H6Ha6P/PQEJ&:%u  %%r   rD   )rE   rF   rG   rH   rI   r   r   r   r   r   r   r   r   rJ   rK   rL   s   @r   r   r      s?     =JL! 7 7& &r   r   c                   T   a  ] tR tRt o RtRtRtR tR tR t	R t
R	 tRR ltRtV tR
# )BaseDateListViewi.  zw
Base class for date-based views displaying a list of objects.

This requires subclassing to provide a response mixin.
Fr   c                    V P                  4       w  V n        V n        pV P                  ! RR V P                  RV P                  /VB pV P	                  V4      # )object_list	date_listrD   )get_dated_itemsr   r   get_context_datarender_to_response)r   r   argsr   extra_contextcontexts   &&*,  r   getBaseDateListView.get8  sa    :>:N:N:P7(-'' 
((
48NN
FS
 &&w//r   c                    \        R4      h)z#Obtain the list of dates and items.z>A DateView must provide an implementation of get_dated_items())NotImplementedErrorr   s   &r   r    BaseDateListView.get_dated_items?  s    !L
 	
r   c                d    V P                   f   RV P                  4       ,          # V P                   # )z]
Return the field or fields to use for ordering the queryset; use the
date field by default.
-%s)orderingr   r   s   &r   get_orderingBaseDateListView.get_orderingE  s*    
 150Eut**,,X4==Xr   c                F   V P                  4       P                  ! R/ VB pV P                  4       pV P                  4       pV P	                  4       pV P                  V4      pV'       gM   V P                  '       d   \        P                  ! 4       M	\        4       pVP                  ! R/ RV,          V/B pV'       gd   Vf   V'       * MVP                  4       '       * pV'       d<   \        \        R4      RVP                  P                  P                  /,          4      hV# )z[
Get a queryset properly filtered according to `allow_future` and any
extra lookup kwargs.
%s__lte$No %(verbose_name_plural)s availableverbose_name_pluralrD   )r   filterr   r   get_allow_emptyget_paginate_byr   r   nowtimezone_todayexistsr   r    r   r   r   )	r   lookupqsr   r   allow_emptypaginate_byr   is_emptys	   &,       r   get_dated_queryset#BaseDateListView.get_dated_querysetL  s    
  ''1&1((*
,,.**,**2.$($<$<$<(,,..BRC;i*4c:;B "-!42vbiik/H<=-rxx~~/Q/Q  	r   c                    V P                   # )zN
Get the aggregation period for the list of dates: 'year', 'month', or
'day'.
)date_list_periodr   s   &r   get_date_list_period%BaseDateListView.get_date_list_periodi      
 $$$r   Nc                z   V P                  4       pV P                  4       pVf   V P                  4       pV P                  '       d   VP	                  WBV4      pMVP                  WBV4      pVeL   V'       gD   V'       g<   \        \        R4      RVP                  P                  P                  /,          4      hV# )zv
Get a date list by calling `queryset.dates/datetimes()`, checking
along the way for empty lists that aren't allowed.
r   r   )r   r   r   r   	datetimesdatesr   r    r   r   r   )r   queryset	date_typer   r   r   r   s   &&&&   r   get_date_listBaseDateListView.get_date_listp  s    
 ((*
**,113I### **:(KI zhGI ;89)8>>+?+?+S+S  r   )r   r   )NASC)rE   rF   rG   rH   rI   r   r   r   r   r   r   r   r   rJ   rK   rL   s   @r   r   r   .  s;      K0
Y:% r   r   c                   .   a  ] tR tRt o RtRtR tRtV tR# )BaseArchiveIndexViewi  ze
Base view for archives of date-based items.

This requires subclassing to provide a response mixin.
latestc                    V P                  4       pV P                  VRR7      pV'       g   VP                  4       pW!/ 3# ):Return (date_list, items, extra_context) for this request.DESC)r   )r   r   none)r   r   r   s   &  r   r   $BaseArchiveIndexView.get_dated_items  s>    $$&&&rF&;	Br""r   rD   N)	rE   rF   rG   rH   rI   context_object_namer   rJ   rK   rL   s   @r   r   r     s      ## #r   r   c                       ] tR tRtRtRtRtR# )ArchiveIndexViewi  z&Top-level archive of date-based items._archiverD   NrE   rF   rG   rH   rI   template_name_suffixrJ   rD   r   r   r   r     s    0%r   r   c                   8   a  ] tR tRt o RtRtRtR tR tRt	V t
R# )	BaseYearArchiveViewi  zt
Base view for a list of objects published in a given year.

This requires subclassing to provide a response mixin.
r7   Fc           
        V P                  4       pV P                  4       p\        WP                  4       4      pV P	                  V4      pV P	                  V P                  V4      4      pRV,          VRV,          V/pV P                  ! R/ VB pV P                  V4      pV P                  4       '       g   VP                  4       pVVRVRV P                  V4      RV P                  V4      /3# )r   r   r   r   	next_yearprevious_yearrD   )r!   r   _date_from_stringr   r   r<   r   r   get_make_object_listr   r-   r1   )	r   r   r   r,   r   r   lookup_kwargsr   r   s	   &        r   r   #BaseYearArchiveView.get_dated_items  s    }}((*
 ';';'=>**40**4+>+>t+DE
"Ez!5

 $$5}5&&r*	((** B T//5!7!7!=
 	
r   c                    V P                   # )zW
Return `True` if this view should contain the full list of objects in
the given year.
)make_object_listr   s   &r   r  (BaseYearArchiveView.get_make_object_list  r   r   rD   N)rE   rF   rG   rH   rI   r   r  r   r  rJ   rK   rL   s   @r   r  r    s(      
@% %r   r  c                       ] tR tRtRtRtRtR# )YearArchiveViewi  z*List of objects published in a given year._archive_yearrD   Nr   rD   r   r   r  r        4*r   r  c                   .   a  ] tR tRt o RtRtR tRtV tR# )BaseMonthArchiveViewi  zu
Base view for a list of objects published in a given month.

This requires subclassing to provide a response mixin.
r8   c           
        V P                  4       pV P                  4       pV P                  4       p\        WP	                  4       W P                  4       4      pV P                  V4      pV P                  V P                  V4      4      pRV,          VRV,          V/pV P                  ! R/ VB pV P                  V4      p	V	VRVRV P                  V4      RV P                  V4      /3# )r   r   r   r7   
next_monthprevious_monthrD   )r!   rV   r   r  r   rR   r   r_   r   r   rY   r\   )
r   r   r7   r   r,   r   r   r	  r   r   s
   &         r   r   $BaseMonthArchiveView.get_dated_items  s    }} ((*
 &&(%1F1F1H
 **40**4+?+?+EF
"Ez!5

 $$5}5&&r*	 d11$7 $"9"9$"?
 	
r   rD   N)	rE   rF   rG   rH   rI   r   r   rJ   rK   rL   s   @r   r  r    s      
 
r   r  c                       ] tR tRtRtRtRtR# )MonthArchiveViewi  z+List of objects published in a given month._archive_monthrD   Nr   rD   r   r   r  r    s    5+r   r  c                   *   a  ] tR tRt o RtR tRtV tR# )BaseWeekArchiveViewi	  zt
Base view for a list of objects published in a given week.

This requires subclassing to provide a response mixin.
c                   V P                  4       pV P                  4       pV P                  4       pV P                  4       pRRRRRR/p WT,          pT P                  4       pTR8X  d   TR	8w  d   \        R
T: RT: R24      h\        YTRY$4      pT P                  T4      p	T P                  T P                  T4      4      p
RT,          T	RT,          T
/pT P                  ! R/ TB pRTRTRT P                  T4      RT P                  T4      /3#   \         d-    \        RT: RRP                  \        T4      4      : 24      hi ; i)r   r   1r   0r   zUnknown week format z. Choices are: z, z%GzISO week directive 'z+' is incompatible with the year directive 'z!'. Use the ISO year '%G' instead.z%wr   r   Nr   	next_weekprevious_weekrD   )r!   r   r   r   r   r;   joinsortedr   r  r   r   r   r   r   )r   r   r   r   r   week_choices
week_startr   r,   r   r   r	  r   s   &            r   r   #BaseWeekArchiveView.get_dated_items  sn   }}}}((*
**,c4dC8		%2J **,$;$#6  	  !JdX**40**4+>+>t+DE
"Ez!5

 $$5}5 T//5!7!7!=
 	
9  	  IIf\23 	s   
D 7E	rD   NrE   rF   rG   rH   rI   r   rJ   rK   rL   s   @r   r  r  	  s     .
 .
r   r  c                       ] tR tRtRtRtRtR# )WeekArchiveViewiA  z*List of objects published in a given week._archive_weekrD   Nr   rD   r   r   r)  r)  A  r  r   r)  c                   0   a  ] tR tRt o RtR tR tRtV tR# )BaseDayArchiveViewiG  zs
Base view for a list of objects published on a given day.

This requires subclassing to provide a response mixin.
c           	         V P                  4       pV P                  4       pV P                  4       p\        VV P	                  4       VV P                  4       VV P                  4       4      pV P                  V4      # r   )r!   rV   rk   r  r   rR   rh   _get_dated_items)r   r   r7   r8   r,   s   &    r   r   "BaseDayArchiveView.get_dated_itemsN  sn    }} lln   "!!#!
 $$T**r   c                    V P                  V4      pV P                  ! R/ VB pRVRVRV P                  V4      RV P                  V4      RV P	                  V4      RV P                  V4      /3# )z}
Do the actual heavy lifting of getting the dated items; this accepts a
date object so that TodayArchiveView can be trivial.
Nr8   previous_daynext_dayr  r  rD   )r   r   rq   rn   r\   rY   )r   r,   r	  r   s   &&  r   r/  #BaseDayArchiveView._get_dated_items_  s    
 55d;$$5}5 t 5 5d ;D--d3 $"9"9$"?d11$7

 
	
r   rD   N)	rE   rF   rG   rH   rI   r   r/  rJ   rK   rL   s   @r   r,  r,  G  s     +"
 
r   r,  c                       ] tR tRtRtRtRtR# )DayArchiveViewit  z)List of objects published on a given day._archive_dayrD   Nr   rD   r   r   r6  r6  t  s    3)r   r6  c                   *   a  ] tR tRt o RtR tRtV tR# )BaseTodayArchiveViewiz  zj
Base view for a list of objects published today.

This requires subclassing to provide a response mixin.
c                \    V P                  \        P                  P                  4       4      # r.  )r/  rv   r,   todayr   s   &r   r   $BaseTodayArchiveView.get_dated_items  s     $$X]]%8%8%:;;r   rD   Nr'  rL   s   @r   r9  r9  z  s     < <r   r9  c                       ] tR tRtRtRtRtR# )TodayArchiveViewi  z List of objects published today.r7  rD   Nr   rD   r   r   r>  r>    s    *)r   r>  c                   :   a a ] tR tRt oRtRV 3R lltRtVtV ;t# )BaseDateDetailViewi  z
Base detail view for a single object on a single date; this differs from
the standard DetailView by accepting a year/month/day in the URL.

This requires subclassing to provide a response mixin.
c           	     ~  < V P                  4       pV P                  4       pV P                  4       p\        VV P	                  4       VV P                  4       VV P                  4       4      pVf   V P                  4       MTpV P                  4       '       gu   V\        P                  P                  4       8  dR   \        \        R4      RVP                  P                  P                   RV P"                  P$                  /,          4      hV P'                  V4      pVP(                  ! R/ VB p\*        SV `Y  VR7      # )z%Get the object this request displays.zZFuture %(verbose_name_plural)s not available because %(class_name)s.allow_future is False.r   
class_name)r   rD   )r!   rV   rk   r  r   rR   rh   r   r   rv   r,   r;  r   r    r   r   r   r   rE   r   r   super
get_object)	r   r   r   r7   r8   r,   r   r	  r   s	   &&      r   rD  BaseDateDetailView.get_object  s   }} lln   "!!#!
 %-$4T ($$&&4(--2E2E2G+G<
 *288>>+M+M $.."9"9		 	 55d;YY''w!2!..r   rD   )N)	rE   rF   rG   rH   rI   rD  rJ   rK   __classcell__)r   rM   s   @@r   r@  r@    s     #/ #/r   r@  c                       ] tR tRtRtRtRtR# )DateDetailViewi  z
Detail view of a single object on a single date; this differs from the
standard DetailView by accepting a year/month/day in the URL.
_detailrD   Nr   rD   r   r   rH  rH    s    
 %r   rH  c                f   W,           V,           V,           V,           p\        V 4      V,           \        V4      ,           V,           \        V4      ,           p \        P                  P                  W4      P                  4       #   \         d!    \        \        R4      RTRT/,          4      hi ; i)z
Get a datetime.date object given a format string and a year, month, and day
(only year is mandatory). Raise a 404 for an invalid date.
uC   Invalid date string “%(datestr)s” given format “%(format)s”datestrformat)strrv   strptimer,   r;   r   r    )	r   r   r7   rQ   r8   rg   delimrL  rK  s	   &&&&&&&  r   r  r    s      </%7*DF$i%#e*,u4s3x?G	
  ))':??AA 
ST7&
 	

s   ,B +B0c                   V P                  4       pV P                  4       pV P                  4       p\        V RV,          4      p\        V RV,          4      pV! V4      V! V4      rV'       dK   V'       d&   V! V	\        P
                  ! ^R7      ,
          4      pMT
pV'       g   V\        4       8:  d   V# R# V'       d%   RV,          V P                  V	4      /pRV,          pMRV,          V P                  V
4      /pTpV'       g>   V P                  '       d   \        P                  ! 4       pM
\        4       pWRV,          &   V P                  4       P                  ! R	/ VB P                  V4      p \        V^ ,          V4      pT P                  '       d=   \        P                   '       d   \        P"                  ! T4      pTP%                  4       pT! T4      #   \         d     R# i ; i)
a  
Get the next or the previous valid date. The idea is to allow links on
month/day views to never be 404s by never providing a date that'll be
invalid for the given view.

This is a bit complicated since it handles different intervals of time,
hence the coupling to generic_view.

However in essence the logic comes down to:

    * If allow_empty and allow_future are both true, this is easy: just
      return the naive result (just the next/previous day/week/month,
      regardless of object existence.)

    * If allow_empty is true, allow_future is false, and the naive result
      isn't in the future, then return it; otherwise return None.

    * If allow_empty is false and allow_future is true, return the next
      date *that contains a valid object*, even if it's in the future. If
      there are no next objects, return None.

    * If allow_empty is false and allow_future is false, return the next
      date that contains a valid object. If that date is in the future, or
      if there are no next objects, return None.
z_get_current_%sz_get_next_%srt   Nr   r   r   r   rD   )r   r   r   getattrrv   rw   r   r   r   r   r   r   r   order_by
IndexErrorr   r   	localtimer,   )generic_viewr,   r'   r(   r   r   r   get_currentget_nextstartendresultr   r   r   r   s   &&&&            r   r*   r*     s   4 ,,.J..0K002L,(9F(BCK|^f%<=H T"HTN3  ););)C!CDFF6^%55M +\-O-OPU-VWFz)H*,l.P.PQT.UVF!H  ///lln$&-09z)*&&(//9&9BB8L	RUJ/F
 +++!++F3[[]F 6""  		s   5G G-,G-c                     \         P                  '       d   \        P                  ! 4       # \        P
                  P                  4       # )z1Return the current date in the current time zone.)r   r   r   	localdaterv   r,   r;  rD   r   r   r   r   2  s-    !!##}}""$$r   ) r]  r]  r]  __)/rv   django.confr   django.core.exceptionsr   	django.dbr   django.httpr   django.utilsr   django.utils.functionalr   django.utils.translationr	   r    django.views.generic.baser
   django.views.generic.detailr   r   django.views.generic.listr   r   r   rO   re   r   r   r   r   r   r  r  r  r  r  r)  r,  r6  r9  r>  r@  rH  r  r*   r   rD   r   r   <module>ri     sq      7   ! 3 1 */, /,d2# 2#j, ,^=F =F@@& @&FX*It Xv#+ #(&:<P &/%)%5 /%d+9;N +%
9j2B %
P,:<P ,5
)Y0@ 5
p+9;N +*
J:J *
Z*8:L *	<- 	<*:<P *+/J)^ +/\%68J %
*W#t%r   