[gen] Added wrapper.createFrom, similar to wrapper.create, but allows to create an object with data from another object (kind of 'duplicate' functionality).

This commit is contained in:
Gaetan Delannay 2014-09-14 21:40:35 +02:00
parent 400158a0a1
commit 4d12293dc8
7 changed files with 70 additions and 34 deletions

View file

@ -533,6 +533,11 @@ class Field:
return self.default
return value
def getCopyValue(self, obj):
'''Gets the value of this field on p_obj as with m_getValue above. But
if this value is mutable, get a copy of it.'''
return self.getValue(obj)
def getFormattedValue(self, obj, value, showChanges=False, language=None):
'''p_value is a real p_obj(ect) value from a field from this type. This
method returns a pretty, string-formatted version, for displaying