shift current week
This commit is contained in:
parent
12b4bc1fbd
commit
19b9f72ed9
4 changed files with 32 additions and 4 deletions
|
|
@ -57,8 +57,9 @@ class Item(models.Model):
|
|||
return json.dumps(comments)
|
||||
|
||||
@classmethod
|
||||
def public(cls):
|
||||
now = timezone.now()
|
||||
def public(cls, now=None):
|
||||
if now is None:
|
||||
now = timezone.now()
|
||||
qs = cls.objects.exclude(published=None).filter(published__lte=now).order_by('-published')
|
||||
cal = now.date().isocalendar()
|
||||
monday = now.date() - timedelta(days=now.date().isocalendar().weekday - 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue