SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 19584a13 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Code for last commit

parent 6389fe93
No related branches found
No related tags found
No related merge requests found
......@@ -169,6 +169,10 @@ class IssueManager(models.Manager):
until_date__gte=timezone.now(),
**kwargs).order_by('-until_date').first()
def get_last_filled_issue(self, *args, **kwargs):
return self.published(publication__isnull=False,
**kwargs).order_by('-until_date').first()
class Issue(models.Model):
in_volume = models.ForeignKey(Volume, on_delete=models.CASCADE)
......@@ -199,6 +203,10 @@ class Issue(models.Model):
return (' (' + self.start_date.strftime('%B') + '-' + self.until_date.strftime('%B') +
' ' + self.until_date.strftime('%Y') + ')')
def is_current(self):
return self.start_date <= timezone.now().date() and\
self.until_date >= timezone.now().date()
def period(self):
text = 'up to {{ until_month }} {{ year }}'
template = Template(text)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment