My program got a strange problem, the exception stack is:
*except Exception, cause: raise ExprEvalError(src, cause)
ExprEvalError: date_after raises NameError: name 'date_after' is not defined*
so the code is:
@staticmethod
def get_recently(days_before=30):
delta = timedelta(days=days_before)
date_after = datetime.now() - delta
return list(Version.select(lambda v:v.create_time>date_after).order_by(desc(Version.create_time))[:])
The ORM framework is Pony,but I don't think it's relate to that.The code can run normally on other pc.
Could you tell me what is the problem? Thanks.
p.s.
- Python-2.7.4
- Pony-0.4.8
Your version of Pony is out of date. There is a closed bug regarding lamdbas in Pony that was resolved months ago, and it was the first (and only) hit for your error '"ExprEvalError" raises NameError: name is not defined' in Google.
Update your version of Pony and it should disappear.