Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectValue's clone() misses self.get_text #7

Open
adamneumann opened this issue Aug 24, 2011 · 0 comments
Open

ObjectValue's clone() misses self.get_text #7

adamneumann opened this issue Aug 24, 2011 · 0 comments

Comments

@adamneumann
Copy link

Hey, I'm a recent new user of Geraldo (version 0.4.12-stable) and love it!

Recently I hit a bug when defining a report using ObjectValue.get_text. Strangely, during report generation the value for get_text is None. Some debugging shows ObjectValue.clone() is called by ReportGenerator.clone() at geraldo/generators/base.py:201, and clone does not copy the reference for get_text.

Our temporary fix for this is to subclass ObjectValue and extend clone:

class CloneObjectValue(ObjectValue):
'''Enhanced ObjectValue with more correct cloning'''

def __init__(self, *args, **kwargs):
    super(CloneObjectValue, self).__init__(*args, **kwargs)

def clone(self):
    new = super(CloneObjectValue, self).clone()
    new.get_text = self.get_text
    return new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant