How to use the emoji.Emoji function in emoji

To help you get started, we’ve selected a few emoji examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gaqzi / django-emoji / test / views.py View on Github external
def get_context_data(self, **kwargs):
        context = (super(EmojiTestReplaceTagView, self)
                   .get_context_data(**kwargs))
        limit = int(self.request.GET.get('limit', 0))
        emojis = []

        for i, emoji in enumerate(sorted(Emoji.keys())):
            if limit and i >= limit:
                break
            emojis.append(':{0}:'.format(emoji))

        context['emojis'] = emojis
        return context
github gaqzi / django-emoji / emoji / tests.py View on Github external
def test_emojiinstance_from_app(self):
        self.assertTrue('dog' in EmojiInstance)
github gaqzi / django-emoji / emoji / templatetags / emoji_tags.py View on Github external
def emoji_replace_html_entities(value, autoescape=None):
    # Replaced before because it needs unescaped &
    value = Emoji.replace_html_entities(value)
    autoescape = autoescape and not isinstance(value, SafeData)
    if autoescape:
        value = escape(value)
    return mark_safe(value)
github gaqzi / django-emoji / emoji / views.py View on Github external
def get(self, request, *args, **kwargs):
        return HttpResponse(json.dumps(dict(Emoji)),
                            content_type='application/json')
github gaqzi / django-emoji / emoji / templatetags / emoji_tags.py View on Github external
def emoji_replace(value, autoescape=None):
    autoescape = autoescape and not isinstance(value, SafeData)
    if autoescape:
        value = escape(value)
    return mark_safe(Emoji.replace(value))