2014-07-25 13:53:01 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2014-07-25 11:20:10 +02:00
|
|
|
from django.db import models
|
|
|
|
|
2014-09-15 16:32:23 +02:00
|
|
|
|
2014-08-11 16:01:03 +02:00
|
|
|
class Project(models.Model):
|
2014-07-28 13:20:13 +02:00
|
|
|
name = models.CharField(max_length=255)
|
|
|
|
description = models.TextField()
|
2014-09-19 11:05:14 +02:00
|
|
|
associated_filename = models.CharField(max_length=255, blank=True, null=True)
|
|
|
|
|
2014-07-28 13:20:13 +02:00
|
|
|
def __unicode__(self):
|
|
|
|
repr = self.name
|
|
|
|
if self.associated_filename:
|
|
|
|
repr += " (" + self.associated_filename + ")"
|
2014-08-11 16:01:03 +02:00
|
|
|
else:
|
2014-09-15 16:32:23 +02:00
|
|
|
repr += " (empty)"
|
|
|
|
return repr
|
|
|
|
|
|
|
|
|
|
|
|
class PersonGlobalIdentity(models.Model):
|
|
|
|
type = models.CharField(max_length=255)
|
2014-09-19 11:05:14 +02:00
|
|
|
# TODO: Extend this for further stuff - maybe vivo external url or something?
|
2014-09-15 16:32:23 +02:00
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
repr = "<PersonGlobalIdentity ID=" + str(self.id) + ", type=" + self.type + ">"
|
|
|
|
return repr
|
|
|
|
|
|
|
|
|
|
|
|
class CitaviProjectIdentity(models.Model):
|
2014-09-15 17:03:09 +02:00
|
|
|
global_identity = models.ForeignKey(PersonGlobalIdentity, blank=True, null=True)
|
2014-09-19 11:52:56 +02:00
|
|
|
project = models.ForeignKey(Project, blank=False, null=False)
|
2014-09-15 17:03:09 +02:00
|
|
|
citavi_uuid = models.CharField(max_length=255, blank=False, null=False)
|
2014-09-19 11:52:56 +02:00
|
|
|
preferred = models.BooleanField()
|
2014-09-19 11:05:14 +02:00
|
|
|
|
2014-09-15 16:32:23 +02:00
|
|
|
def __unicode__(self):
|
2014-09-19 11:52:56 +02:00
|
|
|
repr = "<CitaviProjectIdentity project=" + str(self.project) + ", citavi_uuid=" + self.citavi_uuid + ", global_identity=" + str(self.global_identity) + ", preferred=" + str(self.preferred) + ">"
|
2014-09-19 11:05:14 +02:00
|
|
|
return repr
|