Skip to content

Instantly share code, notes, and snippets.

View alexsosic's full-sized avatar

Aleksandar Sosic alexsosic

View GitHub Profile
@alexsosic
alexsosic / gist:f5d8e3cb1104a02c7c005da8dbf9199a
Created January 26, 2021 21:18 — forked from d-rama/gist:0e5002524ec05da00877bd06e9fe029c
HTML to reportlab flowables converter
# I place this in the public domain
# This only handles non-nested lists, emphasis, headings and horizontal rules (which are converted to page breaks)
# Sufficient for converting Markdown generated HTML to reportlab flowables...
import xml.sax as sax
def html_to_rl(html, styleSheet):
elements = list()
@alexsosic
alexsosic / gist:1684727
Created January 26, 2012 19:56
django-cms apphook problem
# cms_app.py
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class ProdajaApp(CMSApp):
name = _("Prodaja App")
urls = ["prodaja.urls"]
apphook_pool.register(ProdajaApp)