Commit graph

32 commits

Author SHA1 Message Date
Michał Pasternak
b138cafcfa Passing flake8 2022-08-08 00:49:40 +02:00
Hugo van Kemenade
9455b36281 Upgrade to f-strings with 'flynt .' 2022-06-15 15:54:51 +03:00
Hugo van Kemenade
e5e4e55d22 Upgrade Python syntax with pyupgrade --py37-plus 2022-06-15 15:47:52 +03:00
Eugene Prikazchikov
e3318658a5 Update Loader class to up-to-date template loader API
load_template_sources is deprecated in Django 1.9 ad removed in Django2.0
see https://docs.djangoproject.com/en/1.9/releases/1.9/#template-loader-apis-have-changed
2017-12-09 20:40:57 +03:00
Jannis Leidel
bc206765fa
Appease flake8. 2017-11-22 11:01:02 +01:00
Jannis Leidel
d7ecd93cce Port to Python 3 and removed legacy code 2016-09-20 10:34:59 +02:00
Jannis Leidel
f0cfdfa9ce Use better version checks, fix #78 2016-09-20 10:33:24 +02:00
Michael Kutý
078d556390 fix flake8 2015-06-15 16:44:34 +02:00
Michael Kutý
15c4a5930b fix loader for django 1.8 2015-04-28 01:03:45 +02:00
Jannis Leidel
f7378df802 Use __isnull for querying a non-site specific template. Refs #33. 2012-05-19 21:40:47 +02:00
Jannis Leidel
f3fc408385 Get the database name from the routers and dropped support for 1.2.X. 2012-05-07 10:31:24 +02:00
Bojan Mihelac
29f08281d7 Fix #27.
dbtemplates tries to find template from database which is associated
with current site, and if that fails then template from database which
is not associated with any site.
2012-03-30 15:14:21 +02:00
Jannis Leidel
e55e52156f Slight corrections to loader. 2011-08-15 13:08:38 +02:00
Jannis Leidel
09ece4a5e3 Some minor additions to the "performance speedup". Extends the list of authors, too. 2011-08-15 12:53:29 +02:00
Stephan Peijnik
7e93da6a94 Removed license headers, reverted LICENSE file and added a CONTRIBUTORS file. 2011-08-15 12:48:10 +02:00
Stephan Peijnik
2d46b418da Use the cache to remember which templates were not found in the database.
Also reverse the logic of the database lookup. First check if there is
site-specific template in the database and only if that fails
try to load the global template.
This should cut down the number of database queries that need to be executed,
especially in a loop that includes a given template that does not exist
in the database.

Signed-off-by: Stephan Peijnik <spe@anexia.at>
2011-08-15 12:48:02 +02:00
Jannis Leidel
05b109ec5a A bunch of flake8 fixees. 2011-07-01 15:50:04 +02:00
Jannis Leidel
2804cd527f Refactored loader to be class based only. 2011-07-01 15:44:23 +02:00
Jason Mayfield
e694b3dfb8 remove name uniqueness, with migration
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2011-06-15 16:15:31 +02:00
Jannis Leidel
baa451ea22 Updated code to pass more Pyflakes. 2011-04-11 23:16:21 +02:00
Jannis Leidel
5190186f3b BACKWARDS INCOMPATIBLE CHANGE. Refactored caching to just use Django's caching system, instead of its own. 2011-04-11 19:19:00 +02:00
Jannis Leidel
46d1f8b21b Added class based template loader for Django >= 1.2. 2010-06-24 11:46:51 +02:00
leidel
50bc53488b Removed superfluous imports
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@93 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: leidel <leidel@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : 8fb9234f876ad589d244a6d082b7c40e4bf5e8c1
2009-01-21 10:45:39 +00:00
leidel
b7011dce7e Made loader and cache backends site-aware. The filesystem cache backend now saves the files under <dir>/<site_domain>/<file_name>. The Django cache backend the Site id in the cache key. Template is now saved explicitly to backend if not existent in cache (e.g. if deleted manually or invalidated). Bumped version to 0.5.4.
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@88 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: leidel <leidel@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : 564571948adb06cdda915b665aa61d00b3118ed0
2008-12-26 17:39:48 +00:00
leidel
9f0d7a2564 Fixed docstring in template loader.
Fixed wrong return types in FileSystemBackend.

git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@59 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: leidel <leidel@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : 7ea05e043c43c23fbf846bc9ddd80400519631e2
2008-11-02 00:05:48 +00:00
leidel
41ff350628 Refactored template loader to use new backend architecture, that populates the cache by using signals.
Adds a BaseCacheBackend class with a simple API (load, save, remove) to be subclassed and specified in the DBTEMPLATES_CACHE_BACKEND settings.
Adds DjangoCacheBackend (uses Django's own caching mechanism) and FileSystemBackend (simple approach to filesystem saving).

git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@58 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: leidel <leidel@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : fde60d8ab2e834d898d9f662cf013d5546370eeb
2008-11-02 00:05:38 +00:00
leidel
bf711587aa Updated signals code due to backwards incompatible change in Django r8223
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@36 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: leidel <leidel@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : b4d45fbcdf3e92e7e14ad18f8791af611b479fee
2008-08-06 21:15:06 +00:00
arne@rcs4u.de
b0e61f5ba6 fix for templates which have (multiple) directories in their name
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@25 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: arne@rcs4u.de <arne@rcs4u.de@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : 71ab553013820fadcb623a2039d0c51a7ff7f271
2008-04-17 12:52:57 +00:00
arne@rcs4u.de
06dfbb4402 added some docstrings, fixed operation for the case, that settings.DBTEMPLATE_CACHE_DIR is not set. code-cleanup needed ...
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@23 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: arne@rcs4u.de <arne@rcs4u.de@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : a20626f69228166f0dac31a250f00efbaca378db
2008-04-17 10:44:20 +00:00
arne@rcs4u.de
dae109748b added filesystem-based caching of dbtemplates (configured via settings.DBTEMPLATES_CACHE_DIR). docs and tests still missing.
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@22 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: arne@rcs4u.de <arne@rcs4u.de@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : 633aadf3de216f42398f8c57a93d68c28946da3a
2008-04-17 10:20:09 +00:00
leidel
e59bb89f6c again: refactoring as a standalone application
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@13 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: leidel <leidel@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : 7974964ff8ace563a81a23cd6308934a2461e5fb
2007-07-20 14:52:00 +00:00
leidel
bbc00a779b again: refactoring as a standalone application
git-svn-id: https://django-dbtemplates.googlecode.com/svn/trunk@12 cfb8ba98-e953-0410-9cff-959ffddf5974

committer: leidel <leidel@cfb8ba98-e953-0410-9cff-959ffddf5974>

--HG--
extra : convert_revision : 5fc12102108671ddb3b9890c9091bd39cb446728
2007-07-20 14:30:48 +00:00