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
import os | |
import re | |
from django.conf import settings | |
from django.utils.safestring import mark_safe | |
class ResourceType(object): | |
def __init__(self, folder, extension, html): | |
self.folder = folder | |
self.extension = extension |
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.db import models | |
class CachedManager(models.Manager): | |
""" | |
Caches accesses in the form | |
Model.objects.get(field = value) | |
for each field in cached_fields. | |
Cache is invalidated on any delete or update operation, | |
regardless of whether anything was actually deleted or updated. | |
""" |
NewerOlder