Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

from django.db import models 

from django.template.loader import render_to_string 

from django.utils.translation import ugettext_lazy as _ 

 

from markupmirror import settings 

from markupmirror.fields import MarkupMirrorField 

 

 

class MarkupMirrorContent(models.Model): 

    """FeinCMS Page contenttype that stores markup in a MarkupMirrorField. 

 

    """ 

    # TODO: find a way to include a button like richtext content 

    # __name__ = 'richtextcontent' 

 

    content = MarkupMirrorField( 

        verbose_name=_(u"Markup content"), 

        markup_type=settings.MARKUPMIRROR_DEFAULT_MARKUP_TYPE, 

        blank=True) 

 

    class Meta: 

        abstract = True 

        app_label = 'wienfluss' 

        verbose_name = _(u"Markup content") 

        verbose_name_plural = _(u"Markup content") 

 

    def render(self, **kwargs): 

        request = kwargs.get('request') 

        return render_to_string('content/markupmirror/default.html', { 

            'content': self, 

            'request': request 

        }) 

 

 

__all__ = ('MarkupMirrorContent',)