aboutsummaryrefslogtreecommitdiffstats
path: root/brevisurl/models.py
diff options
context:
space:
mode:
authorMarc-Olivier Titeux2013-10-17 10:02:49 +0200
committerMarc-Olivier Titeux2013-10-17 10:02:49 +0200
commit07fc1a178ccc723c365f19ae394d9d2ae220c9d4 (patch)
treea0017204f18b7627d30c5b6d41fef91698be0597 /brevisurl/models.py
parentf18e5efd8b4e93633d270f27ea6987b3c21e8b74 (diff)
downloaddjango-brevisurl-07fc1a178ccc723c365f19ae394d9d2ae220c9d4.tar.bz2
original url length from settings
Diffstat (limited to 'brevisurl/models.py')
-rw-r--r--brevisurl/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/brevisurl/models.py b/brevisurl/models.py
index 9ade639..417fa20 100644
--- a/brevisurl/models.py
+++ b/brevisurl/models.py
@@ -2,6 +2,7 @@ import hashlib
import logging
from django.core.exceptions import ValidationError
+from django.conf import settings
from django.db import models
from django.core.validators import URLValidator
@@ -13,7 +14,7 @@ log = logging.getLogger(__name__)
class ShortUrl(models.Model):
"""Model that represents shortened url."""
- original_url = models.URLField(max_length=200, null=False, blank=False)
+ original_url = models.URLField(max_length=getattr(settings, 'LOCAL_BACKEND_ORIGINAL_URL_MAX_LENGTH', 200), null=False, blank=False)
original_url_hash = models.CharField(max_length=64, null=False, blank=False)
shortened_url = models.URLField(max_length=200, null=False, blank=False, unique=True)
backend = models.CharField(max_length=200, null=False, blank=False)