podjango: Temporarily filter out episodes prior to 2024
This commit is contained in:
		
							parent
							
								
									4a2ed6714a
								
							
						
					
					
						commit
						6ce976e63a
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		|  | @ -18,7 +18,6 @@ | |||
| # | ||||
| from datetime import datetime, timedelta | ||||
| 
 | ||||
| from django.conf import settings | ||||
| from django.db import models | ||||
| from django.urls import reverse | ||||
| 
 | ||||
|  | @ -39,6 +38,12 @@ class CastTag(models.Model): | |||
|         return reverse('podjango:cast') + "?tag=%s" % self.slug | ||||
| 
 | ||||
| 
 | ||||
| class CastManager(models.Manager): | ||||
|     def get_queryset(self): | ||||
|         # Temporarily filter out old FaiF episodes we've imported. | ||||
|         return super().get_queryset().filter(pub_date__year__gte=2024) | ||||
| 
 | ||||
| 
 | ||||
| class Cast(models.Model): | ||||
|     """Cast""" | ||||
| 
 | ||||
|  | @ -58,6 +63,8 @@ class Cast(models.Model): | |||
|     date_created = models.DateTimeField(auto_now_add=True) | ||||
|     date_last_modified = models.DateTimeField(auto_now=True) | ||||
| 
 | ||||
|     objects = CastManager() | ||||
| 
 | ||||
|     class Meta: | ||||
|         db_table = 'casts_entries'  # legacy | ||||
|         verbose_name_plural = 'casts' | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue