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
/* Adapted from bootstrap 4.6.0 */ | |
.container-xxl { | |
width: 100%; | |
padding-right: 15px; | |
padding-left: 15px; | |
margin-right: auto; | |
margin-left: auto; | |
} |
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
class MultiLookupModelViewSet(ModelViewSet): | |
""" | |
Allows you to perform lookups on one or more fields | |
""" | |
lookup_fields = ["pk"] # Override with your lookup fields | |
def get_object(self): | |
""" | |
Returns the object the view is displaying. |
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 redis | |
import json | |
from datetime import datetime, timedelta | |
from redis.exceptions import ResponseError | |
r = redis.Redis(host='localhost', port=6379, db=0, decode_responses=True) | |
now = datetime.now() | |
three_days_from_now = now + timedelta(days=3) | |
keys_to_purge = [] |
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 logging | |
from django.contrib.gis.db.backends.postgis.base import \ | |
DatabaseWrapper as PostgisDBWrapper | |
from django.db import ProgrammingError | |
from .schema import TimescaleSchemaEditor | |
logger = logging.getLogger(__name__) |
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
@register.simple_tag(name='include_raw') | |
def do_include_raw(template_name): | |
from django.template.exceptions import TemplateDoesNotExist | |
from django.template.engine import Engine | |
from django.template.loaders.app_directories import Loader | |
from django.utils.safestring import mark_safe | |
loader = Loader(Engine.get_default()) | |
for origin in loader.get_template_sources(template_name): |