Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji | 
|---|---|
| Initial commit | 🎉 :tada: | 
| Version tag | 🔖 :bookmark: | 
| New feature | ✨ :sparkles: | 
| Bugfix | 🐛 :bug: | 
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji | 
|---|---|
| Initial commit | 🎉 :tada: | 
| Version tag | 🔖 :bookmark: | 
| New feature | ✨ :sparkles: | 
| Bugfix | 🐛 :bug: | 
| def decorator(arg1, arg2): | |
| def wrapper(func): | |
| def inner(*args, **kwargs): | |
| ... | |
| @decorator(1, 2) # my_func = decorator(my_func)(1,2) | |
| def my_func(): | 
| { | |
| "data": [ | |
| { | |
| "type": "hotel-offers", | |
| "hotel": { | |
| "type": "hotel", | |
| "hotelId": "MCLONGHM", | |
| "chainCode": "MC", | |
| "dupeId": "700031300", | |
| "name": "JW Marriott Grosvenor House London", | 
Ok first of all, what is the get_price method ?
The get_price is a method required by the dj-shop-cart package that you must implement on your django model representing the products that you are adding to the cart. The signature is as follow:
class Product(models.Model):
 price = models.DecimalField(decimal_places=2, max_digits=10)| class LocationFilter(django_filters.FilterSet): | |
| q = django_filters.CharFilter(method='my_custom_filter', label="Search") | |
| class Meta: | |
| model = Location | |
| fields = ['q'] | |
| def my_custom_filter(self, queryset, name, value): | |
| return queryset.filter( | |
| Q(loc__icontains=value) | | 
| pg_dump "sslmode=require host=<host> dbname=leerming user=leerming" --data-only -f leerming.sql | |
| psql "host=<host> dbname=leerming user=leerming" < leer.sql | 
| from typing import TYPE_CHECKING | |
| import structlog | |
| from .config import get_redis_url, get_client_tracking_enabled | |
| from functools import wraps | |
| import threading | |
| import redis | |
| import asyncio | |
| if TYPE_CHECKING: | |
| from .brokers import Broker | 
| sse-starlette | |
| starlette | |
| redis | |
| psycopg[c] | 
| import time | |
| from litestar import Litestar, get | |
| from litestar.channels.backends.redis import RedisChannelsPubSubBackend | |
| from litestar.channels.plugin import ChannelsPlugin | |
| from litestar.response.sse import ServerSentEvent | |
| import redis.asyncio as Redis | |
| from typing import Generator, AsyncGenerator | |
| import json | |
| from contextlib import asynccontextmanager | 
| from django.db.models import Case, Value, When, F, Q | |
| def transfer(from_account: Account, to_account: Account, amount: int): | |
| with transaction.atomic(): | |
| count = Account.objects.filter( | |
| Q(pk=from_account.pk, balance__gte=amount) | Q(pk=to_account.pk) | |
| ).update( | |
| balance=Case( |