##// END OF EJS Templates
fix RCLine.get_name()...
Juan C. Espinoza -
r113:bda9db3004db
parent child
Show More
@@ -216,7 +216,7 class RCConfiguration(Configuration):
216 if line_data['TX_ref'] in (0, '0'):
216 if line_data['TX_ref'] in (0, '0'):
217 params['TX_ref'] = '0'
217 params['TX_ref'] = '0'
218 else:
218 else:
219 params['TX_ref'] = [l.pk for l in lines if l.line_type.name=='tx' and l.get_name()==line_data['TX_ref']][0]
219 params['TX_ref'] = [l.pk for l in lines if l.line_type.name=='tx' and line_data['TX_ref'] in l.get_name()][0]
220 line.params = json.dumps(params)
220 line.params = json.dumps(params)
221 line.save()
221 line.save()
222
222
@@ -483,13 +483,13 class RCLine(models.Model):
483 if 'TX_ref' in json.loads(self.params):
483 if 'TX_ref' in json.loads(self.params):
484 pk = json.loads(self.params)['TX_ref']
484 pk = json.loads(self.params)['TX_ref']
485 if pk in (0, '0'):
485 if pk in (0, '0'):
486 s = ','.join(chars[l.position] for l in self.rc_configuration.get_lines(line_type__name='tx'))
486 s = ','.join(chars[l.position] for l in self.rc_configuration.get_lines(line_type__name='tx'))
487 else:
487 else:
488 ref = RCLine.objects.get(pk=pk)
488 ref = RCLine.objects.get(pk=pk)
489 s = chars[ref.position]
489 s = chars[ref.position]
490
490 s = '({})'.format(s)
491 if s:
491 if s:
492 return '{}({}) {}'.format(self.line_type.name.upper(), s, self.channel)
492 return '{}{} {}'.format(self.line_type.name.upper(), s, self.channel)
493 else:
493 else:
494 return '{} {}'.format(self.line_type.name.upper(), self.channel)
494 return '{} {}'.format(self.line_type.name.upper(), self.channel)
495
495
General Comments 0
You need to be logged in to leave comments. Login now