Thanks DAniel.
The models:
class Review(models.Model):
""" A review of one paper."""
INCLUDE_CHOICES = [(True,'Include'),(False,'Exclude')]
paper = models.ForeignKey(Paper, verbose_name=_('Paper'),
related_name="%(app_label)s_%(class)s_related+", null=False,
blank=False, help_text=_("Select a paper."))
title_include = models.NullBooleanField("Title",
choices=INCLUDE_CHOICES,null=False, blank=False, help_text="Select
Exclude to remove from the study after title review.")
title_exclusion_choice = models.ForeignKey(Exclusion, null=False,
blank=False, related_name="%(app_label)s_%(class)s_related+")
title_exclusion_text = models.TextField(null=False, blank=False)
abstract_include = models.NullBooleanField("Abstract",
choices=INCLUDE_CHOICES, null=False, blank=False, help_text="Select
Exclude to remove from the study after abstract review.")
abstract_exclusion_choice = models.ForeignKey(Exclusion,
null=False, blank=False,
related_name="%(app_label)s_%(class)s_related+")
abstract_exclusion_text = models.TextField(null=False, blank=False)
full_text_include = models.NullBooleanField("Fulltext",
choices=INCLUDE_CHOICES, null=False, blank=False, help_text="Select
Exclude to remove from the study after full text review.")
full_text_exclusion_choice = models.ForeignKey(Exclusion,
null=False, blank=False,
related_name="%(app_label)s_%(class)s_related+")
full_text_exclusion_text = models.TextField(null=False, blank=False)
def __str__(self):
return 'Paper: '+self.paper.title
class Paper(models.Model):
STAGES = [('Pre-Selection','Pre-Selection'), ('Selection by
Title','Selection by Title'),
('Selection by Abstract','Selection by Abstract'),
('Selection by Full Text','Selection by Full Text')]
INCLUDE_CHOICES = [(True,'Include'),(False,'Exclude')]
title = models.CharField("Title", max_length=300, help_text="")
language = models.CharField(_("language"), max_length=400,
help_text=_('Enter the language of this paper.'))
repo = models.ForeignKey(Repository,
related_name="%(app_label)s_%(class)s_related",
verbose_name=_('Repository'), null=False,
blank=False,help_text=_("Source repository added when the paper was
generated."))
project = models.ForeignKey(Project,
related_name="%(app_label)s_%(class)s_related", null=True, blank=True)
current_stage = models.CharField("Current Stage",max_length=30,
default="Pre-Selection", choices=STAGES, help_text="The current stage
for this paper.")
journal = models.ForeignKey(Journal,
related_name="%(app_label)s_%(class)s_related",
verbose_name=_('Journal Title'), null=False,
blank=False,help_text=_("Select a Journal."))
authors = models.TextField('Authors', help_text="The authors of
this paper.", null=True, blank=True)
keywords = models.TextField("Keywords", null=True, blank=True,
help_text="" )
doi = models.CharField("DOI", null=True, blank=True,
max_length=70, help_text="Enter the paper DOI")
url = models.CharField("URL", null=True, blank=True,
max_length=255, help_text="Enter the paper URL")
year_published = models.CharField("Year", db_index=True,
max_length=400, help_text="" )
volume = models.CharField("Journal Volume", null=True, blank=True,
max_length=400, help_text="" )
issue = models.CharField("Journal Issue", null=True, blank=True,
max_length=400, help_text="" )
initial_page = models.CharField("Initial Page/Page Range",
max_length=200, default=0, help_text="" )
final_page = models.CharField("Final page", max_length=200,
null=True, blank=True, default=0, help_text="" )
abstract = models.TextField("Abstract", null=True, blank=True,
help_text="Copy/paste the abstract here if it was not provide during
import.")
ca_address = models.TextField("Corresponding Author Address", default='' )
ca_email = models.EmailField("Corresponding Author Email",
max_length=255, db_index=True, null=True, blank=True, help_text="")
nonduplicate = models.NullBooleanField("Duplicate", null=True,
blank=True, choices=INCLUDE_CHOICES, help_text="Select Exclude to
remove due to duplication of papers.")
daterange = models.NullBooleanField("Date Range", null=True,
blank=True, choices=INCLUDE_CHOICES, help_text="Select Exclude to
remove due to the date of publication.")
lang_ok = models.NullBooleanField("Language ", null=True,
blank=True, choices=INCLUDE_CHOICES, help_text="Select Exclude to
remove due to the language.")
comments = models.TextField("Comments", null=True, blank=True,
help_text="Enter your comments.")
objects = PaperManager()
def __str__(self):
return self.title
The Paper Manager (used to produce the PApers from imported text files).
class PaperManager(models.Manager):
def create_paper(self, ptitle,rid,jid,jyear,jvol,jissue,lang,pid):
p = self.create(title=ptitle, repo_id=rid, journal_id=jid,
year_published=jyear,
volume=jvol, issue=jissue,language=lang,project_id=pid)
p.save()
return p
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
django-users...@googlegroups.com.
> To post to this group, send email to
django...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/django-users.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/django-users/e3e51b9d-bd15-4aa6-b481-25c16ad62bcb%40googlegroups.com.
>
> For more options, visit
https://groups.google.com/groups/opt_out.