Skip to content

Instantly share code, notes, and snippets.

@BiTree
BiTree / qs.py
Created November 19, 2021 13:31
"""
A B
b_kf B表的外键 is_admin bool
age int
"""
qs = A.objects.filter(age__gte=13).filter(b_fk__isnull=False).filter(b_fk__is_admin=True) #空的queryset
qs = A.objects.filter(age__gte=13).exclude(b_fk__isnull=True).filter(b_fk__is_admin=True) #查到了正确的queryset
@BiTree
BiTree / p2j.py
Last active August 25, 2021 06:42
import re
import json
ori = """{'java.class.version': '60.0',
'java.home': '/usr/lib/jvm/java-16-openjdk',
'java.runtime.name': 'OpenJDK Runtime Environment',
'java.runtime.version': '16.0.2+7',
'java.specification.name': 'Java Platform API Specification',
'java.specification.vendor': 'Oracle Corporation',
@BiTree
BiTree / py
Created August 25, 2021 05:16
import re
import json
ori = """{'java.class.version': '60.0',
'java.home': '/usr/lib/jvm/java-16-openjdk',
'java.runtime.name': 'OpenJDK Runtime Environment',
'java.runtime.version': '16.0.2+7',
'java.specification.name': 'Java Platform API Specification',
'java.specification.vendor': 'Oracle Corporation',
@BiTree
BiTree / gist:3f447469552773c5dcc10a8246a86b50
Created August 25, 2021 05:16
convert java property file to json
import re
import json
ori = """{'java.class.version': '60.0',
'java.home': '/usr/lib/jvm/java-16-openjdk',
'java.runtime.name': 'OpenJDK Runtime Environment',
'java.runtime.version': '16.0.2+7',
'java.specification.name': 'Java Platform API Specification',
'java.specification.vendor': 'Oracle Corporation',
@BiTree
BiTree / deployment_test.yaml
Created September 18, 2020 03:03
deployment_test
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: abtesthash
enabled: "true"
name: abtesthash
namespace: default
spec:
minReadySeconds: 5