My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Cascading Checkboxes in Python

James Novis's photo
James Novis
·Apr 15, 2019

I'm currently developing a Python code with GUI to minimize my paperwork time. So far so good it adds student payments to Googlesheets, it creates an excel receipt then changes it to pdf and then sends it via gmail to the client....all the hard bits done right? One little area is bothering me and that's the section where you can amend the date.

Usually a client buys four sessions at a time with me so the dates would look something like this. A checkbox next to each one.

Week 1: Jan 1st 2019                   [    ]  - checkbox 1
Week 2: Jan 8th 2019                  [    ]  - checkbox 2
Week 3: Jan 15th 2019                [    ]  - checkbox 3
Week 4: Jan 22nd 2019               [    ]  - checkbox 4

Week to Pay: Jan 29th 2019

When a tick box is ticked I want it so that that date is skipped and replaced with the next week's date. Easy. When it is un-ticked I want it to revert ...easy.

Okay here's the challenge...what if i had different combinations of boxes ticked eg. box one and 3. or 1 and 4?

I need to work out the logic behind this problem.

Any help would be much appreciated.

Kind regards

James