<s> from django . db import models <EOL> from mozdns . domain . models import Domain <EOL> from mozdns . models import MozdnsRecord <EOL> from mozdns . validation import validate_srv_label , validate_srv_port <EOL> from mozdns . validation import validate_srv_priority , validate_srv_weight <EOL> from mozdns . validation import validate_srv_name <EOL> from mozdns . validation import validate_srv_target <EOL> import reversion <EOL> from gettext import gettext as _ <EOL> class SRV ( MozdnsRecord ) : <EOL> """<STR_LIT>""" <EOL> id = models . AutoField ( primary_key = True ) <EOL> label = models . CharField ( max_length = <NUM_LIT> , blank = True , null = True , <EOL> validators = [ validate_srv_label ] , <EOL> help_text = "<STR_LIT>" ) <EOL> domain = models . ForeignKey ( Domain , null = False , help_text = "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> fqdn = models . CharField ( max_length = <NUM_LIT:255> , blank = True , null = True , <EOL> validators = [ validate_srv_name ] ) <EOL> target = models . CharField ( max_length = <NUM_LIT:100> , <EOL> validators = [ validate_srv_target ] , blank = True , <EOL> null = True ) <EOL> port = models . PositiveIntegerField ( null = False , <EOL> validators = [ validate_srv_port ] ) <EOL> priority = models . PositiveIntegerField ( null = False , <EOL> validators = [ validate_srv_priority ] ) <EOL> weight = models . PositiveIntegerField ( null = False , <EOL> validators = [ validate_srv_weight ] ) <EOL> template = _ ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> search_fields = ( "<STR_LIT>" , "<STR_LIT:target>" ) <EOL> def details ( self ) : <EOL> return ( <EOL> ( "<STR_LIT>" , self . fqdn ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , self . target ) , <EOL> ( "<STR_LIT>" , self . port ) , <EOL> ( "<STR_LIT>" , self . priority ) , <EOL> ( "<STR_LIT>" , self . weight ) , <EOL> ) <EOL> class Meta : <EOL> db_table = "<STR_LIT>" <EOL> unique_together = ( "<STR_LIT:label>" , "<STR_LIT>" , "<STR_LIT:target>" , "<STR_LIT:port>" ) <EOL> @ classmethod <EOL> def get_api_fields ( cls ) : <EOL> return super ( SRV , cls ) . get_api_fields ( ) + [ <EOL> '<STR_LIT:port>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:target>' ] <EOL> @ property <EOL> def rdtype ( self ) : <EOL> return '<STR_LIT>' <EOL> reversion . register ( SRV ) </s>
