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 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) |
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
dojo.provide 'cdoc.mixins.search' | |
dojo.require "dijit.form.ValidationTextBox" | |
dojo.require "dijit.layout.BorderContainer" | |
dojo.require "dijit.layout.ContentPane" | |
dojo.require "dojo.data.ItemFileReadStore" | |
dojo.require "cdoc.string.quicksilver" | |
dojo.declare "cdoc.mixins.search", [dijit.layout.BorderContainer], { | |
title: "Mixins" |
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
cdoc.string.quicksilver: (string, abbreviation, offset) -> | |
offset: or 0 | |
len: abbreviation.length | |
return 0.9 if len is 0 | |
return 0.0 if len > string.length | |
for i in [len...0] | |
sub_abbreviation: abbreviation.substring 0, i |