##// END OF EJS Templates
Fixed middlewares
Fixed middlewares

File last commit:

r1986:0b41439a default
r2018:9b956998 default
Show More
banner.py
13 lines | 335 B | text/x-python | PythonLexer
neko259
Added banner to show the site news. Returned the message middleware because it...
r1148 from django.db import models
class Banner(models.Model):
title = models.TextField()
neko259
Allow banner with no text. If so, details post text is used
r1418 text = models.TextField(blank=True, null=True)
neko259
Adapt to django-2.0
r1986 post = models.ForeignKey('Post', on_delete=models.CASCADE)
neko259
Added banner to show the site news. Returned the message middleware because it...
r1148
def __str__(self):
return self.title
neko259
Allow banner with no text. If so, details post text is used
r1418
def get_text(self) -> str:
return self.text or self.post.get_text()