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
<?xml version="1.0" encoding="utf-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" | |
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>magit: tmp</title> | |
<meta name="generator" content="emacs 26.3; htmlfontify 0.21" /> | |
<style type="text/css"><!-- | |
body { font-family: Rec Mono Semicasual; font-stretch: normal; font-weight: 500; font-style: normal; color: #655370; background: #fbf8ef; font-size: 9pt; text-decoration: none; } | |
span.default { font-family: Rec Mono Semicasual; font-stretch: normal; font-weight: 500; font-style: normal; color: #655370; background: #fbf8ef; font-size: 9pt; text-decoration: 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
class AfterFetchQuerySetMixin: | |
""" | |
QuerySet mixin to enable functions to run immediately | |
after records have been fetched from the DB. | |
""" | |
# This is most useful for registering 'prefetch_related' like operations | |
# or complex aggregations that need to be run after fetching, but while | |
# still allowing chaining of other QuerySet methods. | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) |
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 datetime import date | |
from django.db.models import QuerySet | |
import visidata | |
def get_main_attrs(instance): | |
if hasattr(instance, '_meta'): | |
return meta_to_col_list(instance._meta) |
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
def product_detail(request, slug): | |
try: | |
product = Product.objects.get(slug=slug) | |
except Product.DoesNotExist: | |
raise Http404() | |
return TemplateResponse(request, 'products/product_detail.html', { | |
'product': product, | |
}) | |
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
# Quick and dirty URL checker: | |
# | |
# - checks presence of parameters to every callback registered in main urlconf | |
# - checks for bad additional parameters (args without default) | |
# - checks type of parameters if possible | |
# - can handle all Django's built-in path converters, | |
# and any other that has a type annotation on the `to_python` method | |
# | |
# Limitations | |
# - can't check callbacks defined using ``**kwargs`` (e.g. most CBVs) |
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
showcase production | |
+--------------------------+--------------------------+------------------------------------------------------------------+ │+--------------------------+--------------------------+------------------------------------------------------------------+ | |
| Column | Type | Modifiers | │| Column | Type | Modifiers | | |
|--------------------------+--------------------------+------------------------------------------------------------------| │|--------------------------+--------------------------+------------------------------------------------------------------| | |
| id |
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 datetime import date | |
import visidata | |
from django.db.models import QuerySet | |
def get_main_attrs(instance): | |
if hasattr(instance, '_meta'): | |
return meta_to_col_list(instance._meta) | |
elif hasattr(instance, '__attrs_attrs__'): | |
return [(field.name, field.type or visidata.anytype) |
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 visidata | |
from django.db.models import QuerySet | |
def get_main_attrs(instance): | |
retval = [] | |
if hasattr(instance, '_meta'): | |
for field in instance._meta.get_fields(): | |
if not hasattr(field, 'get_attname'): | |
continue |
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
diff --git a/fluent.runtime/fluent/runtime/codegen.py b/fluent.runtime/fluent/runtime/codegen.py | |
index f00f750..b76b147 100644 | |
--- a/fluent.runtime/fluent/runtime/codegen.py | |
+++ b/fluent.runtime/fluent/runtime/codegen.py | |
@@ -3,6 +3,7 @@ Utilities for doing Python code generation | |
""" | |
from __future__ import absolute_import, unicode_literals | |
+import ast | |
import keyword |
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
// Native/Confirm.js | |
var _user$project$Native_Confirm = function () { | |
var scheduler = _elm_lang$core$Native_Scheduler; | |
function confirmTask(prompt, successValue, failValue) { | |
return scheduler.nativeBinding(function (callback) { | |
if (window.confirm(prompt)) { | |
callback(scheduler.succeed(successValue)); | |
} else { |