cf.FieldList.count¶
-
FieldList.count(x)[source]¶ L.count(value) – return number of occurrences of value
Each field in the field list is compared to x with the field’s
equalsmethod (as opposed to the==operator).Note that
f.count(x)is equivalent tosum(g.equals(x) for g in f).See also
cf.Field.equals,list.countExamples: >>> f = cf.FieldList([a, b, c, a]) >>> f.count(a) 2 >>> f.count(b) 1 >>> f.count(a+1) 0