Add a Character.other_characters property.
authorMatthijs Kooijman <matthijs@stdin.nl>
Tue, 13 Jan 2009 17:15:15 +0000 (18:15 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Tue, 13 Jan 2009 17:15:15 +0000 (18:15 +0100)
This property allows other involved Characters to be attached to an
Influence.

SQL: CREATE TABLE `influences_influence_other_characters` (
SQL:     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
SQL:     `influence_id` integer NOT NULL,
SQL:     `character_id` integer NOT NULL,
SQL:     UNIQUE (`influence_id`, `character_id`)
SQL: );
SQL: ALTER TABLE `influences_influence_other_characters` ADD
SQL:   CONSTRAINT influence_id_refs_id_f981877b32ddc18
SQL:   FOREIGN KEY (`influence_id`)
SQL:   REFERENCES `influences_influence` (`id`);
SQL: ALTER TABLE `influences_influence_other_characters` ADD
SQL:   CONSTRAINT character_id_refs_id_56216395feac9718
SQL:   FOREIGN KEY (`character_id`)
SQL:   REFERENCES `influences_character` (`id`);

influences/models.py

index 8478ecc0f728e493f6122797939d9a46300d706b..aa64f269fbca96db6bf6d5479775fed9d0465a11 100644 (file)
@@ -47,6 +47,7 @@ class Influence(models.Model):
     
     initiator   = models.ForeignKey(Character, verbose_name = _("Initiator"), related_name='initiated_influences')
     other_contacts = models.CharField(max_length=255, blank = True, verbose_name = _("Other Contacts"))
+    other_characters = models.ManyToManyField(Character, blank = True, verbose_name = _("Involved characters"), related_name='influences_involved_in')
     summary     = models.CharField(max_length=255, verbose_name = _("Summary"))
     description = models.TextField(verbose_name = _("Description"))
     todo        = models.TextField(verbose_name = _("Todo"))