Created
October 26, 2010 20:17
-
-
Save wilig/647702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@classmethod | |
def create_from_dict(cls, project, profile_id, data_dict, asset_group=None): | |
"""Takes a dict with field_definition ids mapped to values and returns a new asset""" | |
asset = Asset(profile_id) | |
asset.update_from_dict(data_dict) | |
asset.project = project | |
# for fd in project.field_definitions: | |
# if fd.id in data_dict.keys(): | |
# asset.set_field_value(fd, data_dict[fd.id]) | |
return asset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment