mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-28 13:48:16 +00:00
clean up
This commit is contained in:
parent
7a922613ae
commit
4156f96eb6
1 changed files with 6 additions and 3 deletions
|
|
@ -22,19 +22,21 @@ __all__ = (
|
|||
class FobiMetaData(SimpleMetadata):
|
||||
"""Meta data for better representation of the form elements."""
|
||||
|
||||
__mapping = copy.copy(SimpleMetadata.label_lookup.mapping)\
|
||||
|
||||
__mapping = copy.copy(SimpleMetadata.label_lookup.mapping)
|
||||
__mapping.update(
|
||||
{
|
||||
MultipleChoiceWithMaxField: 'multiple choice',
|
||||
ContentImageField: 'content',
|
||||
ContentTextField: 'content',
|
||||
ContentVideoField: 'content',
|
||||
}
|
||||
)
|
||||
|
||||
label_lookup = ClassLookupDict(__mapping)
|
||||
|
||||
def get_field_info(self, field):
|
||||
"""
|
||||
"""Get field info.
|
||||
|
||||
Given an instance of a serializer field, return a dictionary
|
||||
of metadata about it.
|
||||
"""
|
||||
|
|
@ -57,4 +59,5 @@ class FobiMetaData(SimpleMetadata):
|
|||
field_info['contenttype'] = 'video'
|
||||
field_info['content'] = field.initial
|
||||
field_info['raw'] = field.raw_data
|
||||
|
||||
return field_info
|
||||
|
|
|
|||
Loading…
Reference in a new issue