<s> from __future__ import unicode_literals <EOL> from django . db import models <EOL> from django . utils import six <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from reviewboard . diffviewer . models import FileDiff <EOL> from reviewboard . reviews . models . base_comment import BaseComment <EOL> class Comment ( BaseComment ) : <EOL> """<STR_LIT>""" <EOL> anchor_prefix = "<STR_LIT>" <EOL> comment_type = "<STR_LIT>" <EOL> filediff = models . ForeignKey ( FileDiff , verbose_name = _ ( '<STR_LIT>' ) , <EOL> related_name = "<STR_LIT>" ) <EOL> interfilediff = models . ForeignKey ( FileDiff , <EOL> verbose_name = _ ( '<STR_LIT>' ) , <EOL> blank = True , null = True , <EOL> related_name = "<STR_LIT>" ) <EOL> first_line = models . PositiveIntegerField ( _ ( "<STR_LIT>" ) , blank = True , <EOL> null = True ) <EOL> num_lines = models . PositiveIntegerField ( _ ( "<STR_LIT>" ) , blank = True , <EOL> null = True ) <EOL> last_line = property ( lambda self : self . first_line + self . num_lines - <NUM_LIT:1> ) <EOL> def get_absolute_url ( self ) : <EOL> revision_path = six . text_type ( self . filediff . diffset . revision ) <EOL> if self . interfilediff : <EOL> revision_path += "<STR_LIT>" % self . interfilediff . diffset . revision <EOL> return "<STR_LIT>" % ( <EOL> self . get_review_request ( ) . get_absolute_url ( ) , <EOL> revision_path , self . filediff . id , self . filediff . id , <EOL> self . first_line ) </s>
