# -*- coding: utf-8 -*- from django.db import models class Project(models.Model): """ Model representing a citavi project. """ name = models.CharField(max_length=255) description = models.TextField() associated_filename = models.CharField(max_length=255, blank=True, null=True) def __unicode__(self): repr = self.name if self.associated_filename: repr += " (" + self.associated_filename + ")" else: repr += " (empty)" return repr class PersonGlobalIdentity(models.Model): """ Model representing a global person identity in django. Can be used to link any foreign identity to it. """ type = models.CharField(max_length=255) # TODO: Extend this for further stuff - maybe vivo external url or something? def __unicode__(self): repr = "" return repr class CitaviProjectIdentity(models.Model): """ Model representing an identity from a citavi project. """ global_identity = models.ForeignKey(PersonGlobalIdentity, blank=True, null=True) project = models.ForeignKey(Project, blank=False, null=False) citavi_uuid = models.CharField(max_length=255, blank=False, null=False) preferred = models.BooleanField() def __unicode__(self): repr = "" return repr