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 MultiFormMixin(ContextMixin): | |
form_classes = {} | |
prefixes = {} | |
success_urls = {} | |
grouped_forms = {} | |
initial = {} | |
prefix = None | |
success_url = None |
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
""" | |
This needs to go somewhere that will force it to run immediately. | |
As the 'extends' tag always has to be first in a template, it's not | |
possible to use the {% load %} tag for this. Instead it must be | |
loaded in the same way as the django tags. | |
add_to_builtins function changed module in 1.7 | |
""" | |
try: |
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
/* | |
Array/Tuple access | |
type T = ['Item One', 'Item Two', 'Item Three', 'Item Four'] | |
type Util<T extends readonly unknown[]> = % example % | |
*/ | |
T['length'] // 4 |
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 typing import Optional | |
from django.contrib import admin | |
from django.contrib.contenttypes.models import ContentType | |
from django.db.models import ManyToManyField, ForeignKey, Model | |
from django.urls import reverse | |
from django.utils.html import format_html | |
def create_link(linked_obj, app_label: str, label_prop: Optional[str] = None) -> str: |