Ticket #26079: sites.patch

File sites.patch, 951 bytes (added by Eric, 9 years ago)

proposed changes

  • django/contrib/sites/models.py

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    8888    domain = models.CharField(_('domain name'), max_length=100,
    8989        validators=[_simple_domain_name_validator], unique=True)
    9090    name = models.CharField(_('display name'), max_length=50)
     91    protocol = models.CharField(_('prefered protocol'), max_length=32, default="http")
    9192    objects = SiteManager()
    9293
    9394    class Meta:
     
    101102
    102103    def natural_key(self):
    103104        return (self.domain,)
     105
     106    def url(self):
     107        return "%s://%s" % (self.protocol if self.protocol else Site.protocol.default, self.domain)
    104108
    105109
    106110def clear_site_cache(sender, **kwargs):
Back to Top