articles/fields.py
def validate(self, value, form):
        """
        Validate and make sure this is a valid URL
        """
        super(CIFURLField, self).validate(value, form)
        parsed_url = urlparse(value)

        valid_domains = ("theguardian.com", "guardian.co.uk", "gu.com")
        for domain in valid_domains:
            if parsed_url.netloc.find(domain) > -1:
                return

        raise ValidationError(
            "Sorry, %s does not appear to be a Guardian URL" % value,
            code="invalid")

        Validate and make sure this is a valid URL
        
Validate and make sure this is a valid URL
Validate and make sure this is a valid URL
def validate(self, value, form):
        super(CIFURLField, self).validate(value, form)
        parsed_url = urlparse(value)
        valid_domains = ("theguardian.com", "guardian.co.uk", "gu.com")
        for domain in valid_domains:
            if parsed_url.netloc.find(domain) > -1:
                return
        raise ValidationError(
            "Sorry, %s does not appear to be a Guardian URL" % value,
            code="invalid")
def validate ( self , value , form ) : super ( CIFURLField , self ) . validate ( value , form ) parsed_url = urlparse ( value ) valid_domains = ( "theguardian.com" , "guardian.co.uk" , "gu.com" ) for domain in valid_domains : if parsed_url . netloc . find ( domain ) > - 1 : return raise ValidationError ( "Sorry, %s does not appear to be a Guardian URL" % value , code = "invalid" )
Validate and make sure this is a valid URL
Validate and make sure this is a valid URL
"""
        Validate and make sure this is a valid URL
        """
self
value
form