Skip to content

Instantly share code, notes, and snippets.

class QuerySetDoubleIteration(Exception):
"A QuerySet was iterated over twice, you probably want to list() it."
pass
# "Skinny" here means we use iterator by default, rather than
# ballooning in memory.
class SkinnyManager(Manager):
def get_query_set(self):
return SkinnyQuerySet(self.model, using=self._db)
@jonico
jonico / dynamic-runner-selection.yaml
Last active November 2, 2023 04:33
Dynamic selection of GitHub Runners - as GitHub Action matrix builds currently do not allow dynamic values
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build: