projects
/
matthijs
/
projects
/
xerxes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Character.involved property.
[matthijs/projects/xerxes.git]
/
influences
/
models.py
diff --git
a/influences/models.py
b/influences/models.py
index aa64f269fbca96db6bf6d5479775fed9d0465a11..c513c1a5c307e3f29b9365c12252fac42e8acc78 100644
(file)
--- a/
influences/models.py
+++ b/
influences/models.py
@@
-5,6
+5,7
@@
from django.utils.text import normalize_newlines
from django.utils.translation import ugettext_lazy as _
from threadedcomments.models import ThreadedComment
from xerxes.tools.text import rewrap
from django.utils.translation import ugettext_lazy as _
from threadedcomments.models import ThreadedComment
from xerxes.tools.text import rewrap
+from string import strip
# Create your models here.
class Character(models.Model):
# Create your models here.
class Character(models.Model):
@@
-93,6
+94,14
@@
class Influence(models.Model):
prefix=prefix)
return comments
prefix=prefix)
return comments
+ @property
+ def involved(self):
+ """ Returns the Characters and contacts (strings) involved """
+ chars = list(self.other_characters.all())
+ if (self.other_contacts):
+ chars.extend(map(strip,self.other_contacts.split(',')))
+ return chars
+
class Meta:
verbose_name = _("Influence")
verbose_name_plural = _("Influences")
class Meta:
verbose_name = _("Influence")
verbose_name_plural = _("Influences")