Changes between Initial Version and Version 1 of Ticket #12937
- Timestamp:
- Feb 22, 2010, 3:22:21 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12937 – Description
initial v1 2 2 3 3 {{{ 4 bmodels.Contact.objects.select_related('IR_contact','consumer_contact','program','consumer').filter(consumer__file=file).order_by('- 5 date')}}}4 bmodels.Contact.objects.select_related('IR_contact','consumer_contact','program','consumer').filter(consumer__file=file).order_by('-date') 5 }}} 6 6 7 7 And the following models: 8 8 9 9 {{{ 10 11 10 class Contact(models.Model): 12 11 program = models.ForeignKey('agency.Program') 13 consumer = 14 models.ForeignKey('consumer.Consumer',null=True,blank=True) 12 consumer = models.ForeignKey('consumer.Consumer',null=True,blank=True) 15 13 date = models.DateField('Contact Date') 16 14 notes = models.TextField() 17 15 date_added = models.DateTimeField(editable=False) 18 method = 19 models.CharField(max_length=10,choices=choices.CONTACT_METHOD,\ 16 method = models.CharField(max_length=10,choices=choices.CONTACT_METHOD,\ 20 17 null=True,blank=True) 21 18 22 19 # consumer_contact 23 20 class Contact(basemodels.Contact): 24 base = models.OneToOneField(basemodels.Contact, 25 parent_link=True,related_name="consumer_contact") 21 base = models.OneToOneField(basemodels.Contact, parent_link=True,related_name="consumer_contact") 26 22 service = models.ForeignKey(Service) 27 confidential = models.BooleanField(default=False,help_text='These 28 notes will not be visible to general staff') 23 confidential = models.BooleanField(default=False,help_text='These notes will not be visible to general staff') 29 24 group = models.ForeignKey(Group,null=True,blank=True) 30 group_contact = 31 models.ForeignKey('consumer.GroupContact',blank=True,null=True) 25 group_contact = models.ForeignKey('consumer.GroupContact',blank=True,null=True) 32 26 33 27 def save(self, *args, **kwargs): … … 41 35 #ir_contact 42 36 class Contact(basemodels.Contact): 43 44 base=models.OneToOneField(BaseContact,parent_link=True,related_name='IR_contact') 37 base=models.OneToOneField(BaseContact,parent_link=True,related_name='IR_contact') 45 38 IR=models.ForeignKey(IR,blank=True,null=True) 46 47 referred_from=models.ForeignKey(ReferralSource,related_name='IR_referred_from') 48 49 referred_to=models.ManyToManyField(ReferralSource,related_name='IR_referred_to') 50 51 information=models.ManyToManyField(Information,verbose_name='Information 52 Requested') 53 39 referred_from=models.ForeignKey(ReferralSource,related_name='IR_referred_from') 40 referred_to=models.ManyToManyField(ReferralSource,related_name='IR_referred_to') 41 information=models.ManyToManyField(Information,verbose_name='Information Requested') 54 42 }}} 55 43 … … 57 45 58 46 {{{ 59 60 47 SELECT (fields) FROM `base_contact` 61 48 … … 86 73 87 74 WHERE `consumer_consumer`.`file` = 06-1757 ORDER BY `base_contact`.`date` DESC 88 89 75 }}} 90 76