Exemplo n.º 1
0
 def save(self, *args, **kwargs):
     if 'pybb' in settings.INSTALLED_APPS:
         from pybb.util import get_markup_engine
         markup = get_markup_engine()
         self.signature_html = markup.format(self.signature)   
     else:
         self.signature_html = self.signature
     super(CondottieriProfile, self).save(*args, **kwargs)
Exemplo n.º 2
0
 class Meta(object):
     model = PrivateMessage
     fields = ('receivers', 'subject', 'body', 'parent')
     widgets = {
         'body':
         util.get_markup_engine().get_widget_cls(),
         'receivers':
         HeavySelect2MultipleWidget(data_view='private_messages:select2')
     }
     labels = {
         'receivers': _('To'),
     }
Exemplo n.º 3
0
 class Meta(object):
     model = Post
     fields = ('body',)
     widgets = {
         'body': util.get_markup_engine().get_widget_cls(),
     }
Exemplo n.º 4
0
from django.db.models import Q
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views import generic
from django.views.decorators.vary import vary_on_cookie
from django_select2 import Select2View
from pybb import defaults
from pybb.compat import get_username_field
from pybb.util import get_markup_engine, get_pybb_profile_model
from pybb.views import PaginatorMixin

from private_messages.forms import MessageForm
from private_messages.models import PrivateMessage, MessageHandler, MessageThread

MarkupEngine = get_markup_engine()


class InboxView(PaginatorMixin, generic.ListView):
    paginate_by = defaults.PYBB_TOPIC_PAGE_SIZE
    context_object_name = 'message_list'
    template_name = 'pybb/private_messages/inbox.html'

    def get_queryset(self):
        return self.group_into_threads(self.get_messages())

    def get_messages(self):
        return PrivateMessage.objects.filter(messagehandler__receiver=self.request.user, messagehandler__deleted=False)

    def group_into_threads(self, messages):
        """
Exemplo n.º 5
0
from django.db.models import Q
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views import generic
from django.views.decorators.vary import vary_on_cookie
from django_select2 import Select2View
from pybb import defaults
from pybb.compat import get_username_field
from pybb.util import get_markup_engine, get_pybb_profile_model
from pybb.views import PaginatorMixin

from private_messages.forms import MessageForm
from private_messages.models import PrivateMessage, MessageHandler, MessageThread

MarkupEngine = get_markup_engine()


class InboxView(PaginatorMixin, generic.ListView):
    paginate_by = defaults.PYBB_TOPIC_PAGE_SIZE
    context_object_name = 'message_list'
    template_name = 'pybb/private_messages/inbox.html'

    def get_queryset(self):
        return self.group_into_threads(self.get_messages())

    def get_messages(self):
        return PrivateMessage.objects.filter(
            messagehandler__receiver=self.request.user,
            messagehandler__deleted=False)
Exemplo n.º 6
0
Arquivo: models.py Projeto: lnroma/aor
 def save(self, *args, **kwargs):
     self.body_html = pybb_util.get_markup_engine().format(
         self.message.body)
     super(AorMessage, self).save(*args, **kwargs)
Exemplo n.º 7
0
Arquivo: models.py Projeto: hovel/aor
 def save(self, *args, **kwargs):
     self.body_html = pybb_util.get_markup_engine().format(self.message.body)
     super(AorMessage, self).save(*args, **kwargs)
Exemplo n.º 8
0
Arquivo: forms.py Projeto: lnroma/aor
 class Meta(WriteForm.Meta):
     widgets = {
         'body': util.get_markup_engine().get_widget_cls(),
     }
Exemplo n.º 9
0
Arquivo: forms.py Projeto: lnroma/aor
 class Meta(FullReplyForm.Meta):
     widgets = {
         'body': util.get_markup_engine().get_widget_cls(),
     }