class LotDate_validation: STATE=[] def __init__(self, award_decision_date, cancellation_date, estimated_start_date, estimated_completion_date, completion_date): self.estimated_start_date=estimated_start_date self.award_decision_date=award_decision_date self.cancellation_date=cancellation_date self.estimated_completion_date=estimated_completion_date self.completion_date=completion_date def Estimated_Start_Date_Estimated_Completion_Date(self): 'validating if estimated_completion_date is later than the estimated_start_date' if self.estimated_completion_date is not None and self.estimated_completion_date > self.estimated_start_date: LotDate_validation.STATE=True return LotDate_validation.STATE else: LotDate_validation.STATE=False return LotDate_validation.STATE def Estimated_Start_Date_Award_Decision_Date(self): 'validating if award_decision_date is earlier than the estimated_start_date' if self.award_decision_date is not None and self.award_decision_date < self.estimated_start_date: LotDate_validation.STATE=True return LotDate_validation.STATE else: LotDate_validation.STATE=False return LotDate_validation.STATE def Estimated_Start_Date_Completion_Date(self): 'validating if completion_date is later than the estimated_start_date' if self.completion_date is not None and self.completion_date > self.estimated_start_date: LotDate_validation.STATE=True return LotDate_validation.STATE else: LotDate_validation.STATE=False return LotDate_validation.STATE def Cancellation_Date_Award_Decision_Date(self): 'validating if cancellation_date is later than or equal to award_decision_date' if self.cancellation_date is not None and self.award_decision_date is not None and self.cancellation_date >= self.award_decision_date: LotDate_validation.STATE=True return LotDate_validation.STATE else: LotDate_validation.STATE=False return LotDate_validation.STATE # This is just for the sake of testing firstcontract=LotDate_validation('22-09-2009', None, '05-10-2009', '04-10-2010', '04-10-2010') firstcontract.Cancellation_Date_Award_Decision_Date()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question