Skip to content

Commit e1d94fc

Browse files
committed
Set related_name values for prev_state and prev_sub_state, even though
I can't see a use for them, since setting "None" doesn't actually remove the reverse relation. - Legacy-Id: 115
1 parent ab92a83 commit e1d94fc

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

ietf/idtracker/models.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,14 @@ class IDInternal(models.Model):
355355
email_display = models.CharField(blank=True, maxlength=50)
356356
agenda = models.IntegerField(null=True, blank=True)
357357
cur_state = models.ForeignKey(IDState, db_column='cur_state', related_name='docs')
358-
prev_state = models.ForeignKey(IDState, db_column='prev_state', related_name=None)
358+
prev_state = models.ForeignKey(IDState, db_column='prev_state', related_name='docs_prev')
359359
assigned_to = models.CharField(blank=True, maxlength=25)
360360
mark_by = models.ForeignKey(IESGLogin, db_column='mark_by', related_name='marked')
361361
job_owner = models.ForeignKey(IESGLogin, db_column='job_owner', related_name='documents')
362362
event_date = models.DateField(null=True)
363363
area_acronym = models.ForeignKey(Areas)
364364
cur_sub_state = models.ForeignKey(IDSubState, related_name='docs', null=True, blank=True)
365-
prev_sub_state = models.ForeignKey(IDSubState, related_name=None, null=True, blank=True)
365+
prev_sub_state = models.ForeignKey(IDSubState, related_name='docs_prev', null=True, blank=True)
366366
returning_item = models.IntegerField(null=True, blank=True)
367367
telechat_date = models.DateField(null=True, blank=True)
368368
via_rfc_editor = models.IntegerField(null=True, blank=True)
@@ -393,7 +393,6 @@ def document(self):
393393
def comments(self):
394394
return self.documentcomment_set.all().filter(rfc_flag=self.rfc_flag).order_by('-comment_date','-comment_time')
395395
def ballot_set(self):
396-
# can't access manager via self; use the class name
397396
return IDInternal.objects.filter(ballot_id=self.ballot_id)
398397
class Meta:
399398
db_table = 'id_internal'

0 commit comments

Comments
 (0)