Ejemplo n.º 1
0
 def __unicode__(self):
     parts = [u'%s' % self.issue.title]
     # little hack to get django's datetime support for stftime
     # when the year is < 1900
     parts.append(strftime(self.issue.date_issued, '%B %d, %Y'))
     if self.issue.edition_label:
         parts.append(self.issue.edition_label)
     if self.section_label:
         parts.append(self.section_label)
     parts.append('Image %s' % self.sequence)
     return u', '.join(parts)
Ejemplo n.º 2
0
 def __unicode__(self):
     parts = [u'%s' % self.issue.title]
     # little hack to get django's datetime support for stftime
     # when the year is < 1900
     parts.append(strftime(self.issue.date_issued, '%B %d, %Y'))
     if self.issue.edition_label:
         parts.append(self.issue.edition_label)
     if self.section_label:
         parts.append(self.section_label)
     parts.append('Image %s' % self.sequence)
     return u', '.join(parts)
Ejemplo n.º 3
0
    def json(self, host, serialize=True):
        j = {
            "@context": "http://iiif.io/api/presentation/2/context.json", 
            "@id": settings.BASE_URL + self.json_url,
            "@type": "sc:Collection",
            "label": self.display_name,
            "manifests": [],
            "metadata": self.metadata
        }

        for issue in self.issues.all():
            j["manifests"].append({
                "@id": settings.BASE_URL + issue.json_url,
                "@type": "sc:Manifest",
                "label": strftime(issue.date_issued, "%Y-%m-%d")
            })

        if serialize:
            return json.dumps(j, indent=2)
        return j
Ejemplo n.º 4
0
    def json(self, host, serialize=True):
        j = {
            "@context": "http://iiif.io/api/presentation/2/context.json", 
            "@id": settings.BASE_URL + self.json_url,
            "@type": "sc:Collection",
            "label": self.display_name,
            "manifests": [],
            "metadata": self.metadata
        }

        for issue in self.issues.all():
            j["manifests"].append({
                "@id": settings.BASE_URL + issue.json_url,
                "@type": "sc:Manifest",
                "label": strftime(issue.date_issued, "%Y-%m-%d")
            })

        if serialize:
            return json.dumps(j, indent=2)
        return j