| 369 | | metaAttr.setAttributeFromMultiValueDict( |
|---|
| 370 | | self.domainObject, self.data |
|---|
| 371 | | ) |
|---|
| 372 | | self.domainObject.save() |
|---|
| 373 | | |
|---|
| | 375 | if metaAttr.name in self.data: |
|---|
| | 376 | metaAttrs[metaAttr.name] = metaAttr |
|---|
| | 377 | for attrName in metaAttrs: |
|---|
| | 378 | metaAttr = metaAttrs[attrName] |
|---|
| | 379 | try: |
|---|
| | 380 | domValue = metaAttr.makeValueFromMultiValueDict(multiValueDict) |
|---|
| | 381 | attrValues[attrName] = domValue |
|---|
| | 382 | except Exception, inst: |
|---|
| | 383 | msg = "Can't make '%s' value from multi-value dict: %s" % ( |
|---|
| | 384 | attrName, multiValueDict |
|---|
| | 385 | ) |
|---|
| | 386 | self.logger.error(msg) |
|---|
| | 387 | raise |
|---|
| | 388 | for attrName in metaAttrs: |
|---|
| | 389 | metaAttr = metaAttrs[attrName] |
|---|
| | 390 | attrValue = attrValues[attrName] |
|---|
| | 391 | if attrValue != metaAttr.getAttributeValue(domainObject): |
|---|
| | 392 | msg = "Setting '%s' attribute to '%s'." % (attrName, attrValue) |
|---|
| | 393 | self.logger.debug(msg) |
|---|
| | 394 | metaAttr.setAttributeValue(domainObject, attrValue) |
|---|
| | 395 | |
|---|