This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.base import BaseCommand | |
from filer.models import Folder | |
class Command(BaseCommand): | |
def handle(self, *args, **options): | |
Folder._tree_manager.rebuild() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src='https://www.google.com/recaptcha/api.js?hl=de'></script> | |
check https://developers.google.com/recaptcha/docs/invisible | |
<div | |
id="header_recaptcha" | |
class="g-recaptcha" | |
data-sitekey="6LctdiQUAAAAAOTUOX92-PkGJXpZgGUp5hrq4l65" | |
data-size="invisible" | |
data-callback="recaptcha_submit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define("text", ["module"], function(t) { | |
"use strict"; | |
var e, a, i = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0"], o = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, s = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im, r = "undefined" != typeof location && location.href, n = r && location.protocol && location.protocol.replace(/\:/, ""), d = r && location.hostname, h = r && (location.port || void 0), m = [], l = t.config && t.config() || {}; | |
return e = { | |
version: "2.0.1", | |
strip: function(t) { | |
if (t) { | |
t = t.replace(o, ""); | |
var e = t.match(s); | |
e && (t = e[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# full of prints, forgive me ;-) | |
# coding: utf-8 | |
from __future__ import unicode_literals | |
import os | |
from pdfminer.pdfdocument import PDFEncryptionError | |
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer.converter import TextConverter | |
from pdfminer.layout import LAParams |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from __future__ import unicode_literals | |
import os | |
from pdfminer.pdfdocument import PDFEncryptionError | |
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer.converter import TextConverter | |
from pdfminer.layout import LAParams | |
from pdfminer.pdfpage import PDFPage | |
from cStringIO import StringIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Counting objects: 4, done. | |
Delta compression using up to 8 threads. | |
Compressing objects: 100% (4/4), done. | |
Writing objects: 100% (4/4), 362 bytes | 362.00 KiB/s, done. | |
Total 4 (delta 3), reused 0 (delta 0) | |
remote: runtime/cgo: pthread_create failed: Resource temporarily unavailable | |
remote: SIGABRT: abort | |
remote: PC=0x1261fd8 m=11 sigcode=18446744073709551610 | |
remote: | |
remote: goroutine 0 [idle]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add to your normal cms_plugins.py whateverplugin | |
class DemoPlugin(CMSPluginBase): | |
model = Demo | |
... | |
def get_plugin_urls(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cms.toolbar_pool import toolbar_pool | |
from cms.cms_toolbars import PlaceholderToolbar | |
toolbar_pool.unregister(PlaceholderToolbar) | |
@toolbar_pool.register | |
class PlaceholderToolbarNoWizard(PlaceholderToolbar): | |
def add_wizard_button(self): | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> ./manage.py datamigration your_app rename_plugin_tables | |
def rename_tables(db, table_mapping, reverse=False): | |
""" | |
renames tables from source to destination name, if the source exists and the destination does | |
not exist yet. | |
""" | |
from django.db import connection | |
if reverse: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aldryn_search.search_indexes import TitleIndex | |
from cms.models import CMSPlugin | |
from djangocms_misc.global_untranslated_placeholder.utils import get_untranslated_default_language | |
class UntranslatedTitleIndex(TitleIndex): | |
def get_plugin_queryset(self, language): | |
queryset = CMSPlugin.objects.filter( | |
language=get_untranslated_default_language() |
NewerOlder