mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
Highlight on request.
This commit is contained in:
parent
2fd5c0e4e8
commit
50ca0e2234
1 changed files with 1 additions and 4 deletions
|
@ -18,7 +18,6 @@ class Snippet(models.Model):
|
|||
title = models.CharField(_(u'Title'), max_length=120, blank=True)
|
||||
author = models.CharField(_(u'Author'), max_length=30, blank=True)
|
||||
content = models.TextField(_(u'Content'), )
|
||||
content_highlighted = models.TextField(_(u'Highlighted Content'), blank=True)
|
||||
lexer = models.CharField(_(u'Lexer'), max_length=30, default=LEXER_DEFAULT)
|
||||
published = models.DateTimeField(_(u'Published'), blank=True)
|
||||
expires = models.DateTimeField(_(u'Expires'), blank=True, help_text='asdf')
|
||||
|
@ -31,14 +30,12 @@ class Snippet(models.Model):
|
|||
return len(self.content.splitlines())
|
||||
|
||||
def content_splitted(self):
|
||||
return self.content_highlighted.splitlines()
|
||||
return self.content.splitlines()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.pk:
|
||||
self.published = datetime.datetime.now()
|
||||
self.secret_id = generate_secret_id()
|
||||
#self.content_highlighted = pygmentize(self.content, self.lexer)
|
||||
self.content_highlighted = self.content
|
||||
super(Snippet, self).save(*args, **kwargs)
|
||||
|
||||
def get_absolute_url(self):
|
||||
|
|
Loading…
Reference in a new issue