255 'generic': {'main': 'relations'}, |
255 'generic': {'main': 'relations'}, |
256 'generated': {'main': 'hidden'}, |
256 'generated': {'main': 'hidden'}, |
257 } |
257 } |
258 |
258 |
259 _allowed_form_types = ('main', 'inlined', 'muledit') |
259 _allowed_form_types = ('main', 'inlined', 'muledit') |
260 _allowed_values = {'main': ('attributes', 'relations', 'metadata', 'hidden'), |
260 _allowed_values = {'main': ('attributes', 'inlined', 'relations', |
|
261 'metadata', 'hidden'), |
261 'inlined': ('attributes', 'hidden'), |
262 'inlined': ('attributes', 'hidden'), |
262 'muledit': ('attributes', 'hidden'), |
263 'muledit': ('attributes', 'hidden'), |
263 } |
264 } |
264 |
265 |
265 @staticmethod |
266 @staticmethod |
309 if section is None: |
310 if section is None: |
310 tag = formtype |
311 tag = formtype |
311 for formtype, section in self.bw_tag_map[tag].iteritems(): |
312 for formtype, section in self.bw_tag_map[tag].iteritems(): |
312 warn('[3.6] add tag to autoform section by specifying form ' |
313 warn('[3.6] add tag to autoform section by specifying form ' |
313 'type and tag. Replace %s by formtype=%s, section=%s' |
314 'type and tag. Replace %s by formtype=%s, section=%s' |
314 % (tag, formtype, section), DeprecationWarning, stacklevel=2) |
315 % (tag, formtype, section), DeprecationWarning, |
|
316 stacklevel=3) |
315 self.tag_relation(key, formtype, section) |
317 self.tag_relation(key, formtype, section) |
316 assert formtype in self._allowed_form_types, \ |
318 assert formtype in self._allowed_form_types, \ |
317 'formtype should be in (%s), not %s' % ( |
319 'formtype should be in (%s), not %s' % ( |
318 ','.join(self._allowed_form_types), formtype) |
320 ','.join(self._allowed_form_types), formtype) |
319 assert section in self._allowed_values[formtype], \ |
321 assert section in self._allowed_values[formtype], \ |