equal
deleted
inserted
replaced
61 :eidparam: |
61 :eidparam: |
62 bool flag telling if this field is linked to a specific entity |
62 bool flag telling if this field is linked to a specific entity |
63 :role: |
63 :role: |
64 when the field is linked to an entity attribute or relation, tells the |
64 when the field is linked to an entity attribute or relation, tells the |
65 role of the entity in the relation (eg 'subject' or 'object') |
65 role of the entity in the relation (eg 'subject' or 'object') |
|
66 :fieldset: |
|
67 optional fieldset to which this field belongs to |
66 |
68 |
67 """ |
69 """ |
68 # default widget associated to this class of fields. May be overriden per |
70 # default widget associated to this class of fields. May be overriden per |
69 # instance |
71 # instance |
70 widget = TextInput |
72 widget = TextInput |
74 __creation_rank = 0 |
76 __creation_rank = 0 |
75 |
77 |
76 def __init__(self, name=None, id=None, label=None, help=None, |
78 def __init__(self, name=None, id=None, label=None, help=None, |
77 widget=None, required=False, initial=None, |
79 widget=None, required=False, initial=None, |
78 choices=None, sort=True, internationalizable=False, |
80 choices=None, sort=True, internationalizable=False, |
79 eidparam=False, role='subject'): |
81 eidparam=False, role='subject', fieldset=None): |
80 self.name = name |
82 self.name = name |
81 self.id = id or name |
83 self.id = id or name |
82 self.label = label or name |
84 self.label = label or name |
83 self.help = help |
85 self.help = help |
84 self.required = required |
86 self.required = required |
86 self.choices = choices |
88 self.choices = choices |
87 self.sort = sort |
89 self.sort = sort |
88 self.internationalizable = internationalizable |
90 self.internationalizable = internationalizable |
89 self.eidparam = eidparam |
91 self.eidparam = eidparam |
90 self.role = role |
92 self.role = role |
|
93 self.fieldset = fieldset |
91 self.init_widget(widget) |
94 self.init_widget(widget) |
92 # ordering number for this field instance |
95 # ordering number for this field instance |
93 self.creation_rank = Field.__creation_rank |
96 self.creation_rank = Field.__creation_rank |
94 Field.__creation_rank += 1 |
97 Field.__creation_rank += 1 |
95 |
98 |