From: Matthijs Kooijman Date: Tue, 13 Jan 2009 17:15:15 +0000 (+0100) Subject: Add a Character.other_characters property. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=d2c32e093a5f0bee8f4188cb7921de62051951be;p=matthijs%2Fprojects%2Fxerxes.git Add a Character.other_characters property. 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`); --- diff --git a/influences/models.py b/influences/models.py index 8478ecc..aa64f26 100644 --- a/influences/models.py +++ b/influences/models.py @@ -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"))