Merge branch 'master' of https://git.fet.at/bofh/fet2020
This commit is contained in:
@@ -6,7 +6,8 @@ from django.utils import timezone
|
|||||||
from django.utils.text import slugify
|
from django.utils.text import slugify
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from taggit.managers import TaggableManager
|
from taggit.managers import TaggableManager
|
||||||
|
import logging
|
||||||
|
request_logger = logging.getLogger('django.request')
|
||||||
# import documents
|
# import documents
|
||||||
from documents import ep
|
from documents import ep
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ class Post(models.Model):
|
|||||||
('E', _('Event')),
|
('E', _('Event')),
|
||||||
('F', _('FetMeeting'))
|
('F', _('FetMeeting'))
|
||||||
]
|
]
|
||||||
post_type = models.CharField(max_length=1, choices=__choices, editable=False)
|
post_type = models.CharField(max_length=1, choices=__choices, editable=True)
|
||||||
|
|
||||||
# post is pinned at main page
|
# post is pinned at main page
|
||||||
is_pinned = models.BooleanField(verbose_name="ANGEHEFTET", default=False)
|
is_pinned = models.BooleanField(verbose_name="ANGEHEFTET", default=False)
|
||||||
@@ -100,7 +101,13 @@ class Post(models.Model):
|
|||||||
def get_tags(self):
|
def get_tags(self):
|
||||||
"""Returns assigned tags as a comma seperated list."""
|
"""Returns assigned tags as a comma seperated list."""
|
||||||
return ",".join(self.tags.names())
|
return ",".join(self.tags.names())
|
||||||
|
@property
|
||||||
|
def agenda_html(self):
|
||||||
|
return "<h1>Agenda</h1>"
|
||||||
|
|
||||||
|
#@agenda_html.setter
|
||||||
|
#def agenda_html_set(self, value):
|
||||||
|
# return value
|
||||||
@property
|
@property
|
||||||
def get_tagnames(self):
|
def get_tagnames(self):
|
||||||
return ["#%s" % t for t in self.tags.names()]
|
return ["#%s" % t for t in self.tags.names()]
|
||||||
@@ -152,6 +159,7 @@ class Post(models.Model):
|
|||||||
|
|
||||||
if self.has_protocol:
|
if self.has_protocol:
|
||||||
self.protocol_key = ep.createPadifNotExists(self.slug + "-protocol")
|
self.protocol_key = ep.createPadifNotExists(self.slug + "-protocol")
|
||||||
|
request_logger.info(self.post_type)
|
||||||
|
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
|
|
||||||
@@ -173,11 +181,14 @@ class PostSerializer(serializers.HyperlinkedModelSerializer):
|
|||||||
'subtitle',
|
'subtitle',
|
||||||
'body',
|
'body',
|
||||||
'url',
|
'url',
|
||||||
|
'post_type',
|
||||||
'public_date',
|
'public_date',
|
||||||
'legacy_id',
|
'legacy_id',
|
||||||
'image',
|
'image',
|
||||||
'event_start',
|
'event_start',
|
||||||
'event_end'
|
'event_end',
|
||||||
|
'is_hidden', 'agenda_html'
|
||||||
|
# 'author'#,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user