1 | 19a20,22
|
---|
2 | > def escape_label(name):
|
---|
3 | > return escape(name + ':')
|
---|
4 | >
|
---|
5 | 45c48
|
---|
6 | < def __init__(self, data=None, auto_id='id_%s', prefix=None, initial=None):
|
---|
7 | ---
|
---|
8 | > def __init__(self, data=None, auto_id='id_%s', prefix=None, initial=None, label_from_name = pretty_name, escape_label = escape_label):
|
---|
9 | 48a52,53
|
---|
10 | > self.label_from_name = label_from_name
|
---|
11 | > self.escape_label = escape_label
|
---|
12 | 102c107
|
---|
13 | < bf = BoundField(self, field, name)
|
---|
14 | ---
|
---|
15 | > bf = BoundField(self, field, name, label_from_name = self.label_from_name)
|
---|
16 | 111c116
|
---|
17 | < label = bf.label and bf.label_tag(escape(bf.label + ':')) or ''
|
---|
18 | ---
|
---|
19 | > label = bf.label and bf.label_tag(self.escape_label(bf.label)) or ''
|
---|
20 | 199c204
|
---|
21 | < def __init__(self, form, field, name):
|
---|
22 | ---
|
---|
23 | > def __init__(self, form, field, name,label_from_name = pretty_name):
|
---|
24 | 205c210
|
---|
25 | < self.label = pretty_name(name)
|
---|
26 | ---
|
---|
27 | > self.label = label_from_name(name)
|
---|