Skip to content

Instantly share code, notes, and snippets.

里丰 gaozhidf

Block or report user

Report or block gaozhidf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tree.py
class Node(object):
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right = right
def max_of_tree(root):
if not root:
return 0
View press.one
https://press.one/p/address/v?s=47f5bc74b4bf731ac52eb5cad5c2326262c1dda91247c7a6ab519ca6e15a995de946cd2387d7cb6eb9314a3646810f93165d6b49b9199052ac706c63e9b376a10&h=8707eadc65083c9d024da35ee3ce4cf12db2600f50e32ac4f667a81dd2cf2682&a=23315027f25d1b51a6078cf04847d7624138eb87&f=P1&v=2
View query.py
ids = [9, 8, 1, 2, 7, 3]
results = Model.objects.filter(id__in=ids).extra(
select={'manual': 'FIELD(id,%s)' % ','.join(map(str, ids))},
order_by=['manual']
)
You can’t perform that action at this time.