Skip to content

Commit

Permalink
Merge pull request #113 from samuelveigarangel/issue-112
Browse files Browse the repository at this point in the history
Adiciona o modelo Collab e o campo Article.collabs
  • Loading branch information
robertatakenaka authored Nov 22, 2024
2 parents e68b78e + 8648cca commit 2bb30ec
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions opac_schema/v1/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,33 @@ class AuthorMeta(EmbeddedDocument):
def __unicode__(self):
return '%s - %s - %s' % (self.name, self.affiliation, self.orcid)

class Collab(EmbeddedDocument):
"""
Model responsible for collab.
Example of this model:
"collab" : [
{
"name" : "Institution",
},
{
"name" : "Institution 2",
},
{
"name" : "Institution 3",
},
]
"""
name = StringField()

meta = {
'collection': 'collab'
}

def __unicode__(self):
return '%s' % (self.name)


class RelatedArticle(EmbeddedDocument):
"""
Expand Down Expand Up @@ -772,6 +799,7 @@ class Article(Document):
display_full_text = BooleanField(required=True, default=True)

related_articles = EmbeddedDocumentListField(RelatedArticle)
collabs = EmbeddedDocumentListField(Collab)

meta = {
'collection': 'article',
Expand Down

0 comments on commit 2bb30ec

Please sign in to comment.