Increased slug

This commit is contained in:
Martin Mahner 2011-08-27 12:15:00 +02:00
parent e38a7b89ab
commit fd43a9b02c

View file

@ -10,11 +10,11 @@ from django.utils.translation import ugettext_lazy as _
from pastebin.apps.dpaste.highlight import LEXER_DEFAULT, pygmentize from pastebin.apps.dpaste.highlight import LEXER_DEFAULT, pygmentize
t = 'abcdefghijkmnopqrstuvwwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ1234567890' t = 'abcdefghijkmnopqrstuvwwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ1234567890'
def generate_secret_id(length=4): def generate_secret_id(length=5):
return ''.join([random.choice(t) for i in range(length)]) return ''.join([random.choice(t) for i in range(length)])
class Snippet(models.Model): class Snippet(models.Model):
secret_id = models.CharField(_(u'Secret ID'), max_length=4, blank=True) secret_id = models.CharField(_(u'Secret ID'), max_length=255, blank=True)
title = models.CharField(_(u'Title'), max_length=120, blank=True) title = models.CharField(_(u'Title'), max_length=120, blank=True)
author = models.CharField(_(u'Author'), max_length=30, blank=True) author = models.CharField(_(u'Author'), max_length=30, blank=True)
content = models.TextField(_(u'Content'), ) content = models.TextField(_(u'Content'), )