Closed m1ckyb closed 6 months ago
Thanks! After adding the field and running the migration, you should be able to save it by adding req_bus
to the guest object here:
https://github.com/czue/django-wedding-website/blob/master/guests/views.py#L74-L81
You will also have to parse the form value here:
https://github.com/czue/django-wedding-website/blob/master/guests/views.py#L99-L109
Note: I have no recollection of why I did form parsing that way instead of using Django forms. But it should be relatively easy to adapt by copy/pasting what's already there.
Thanks for your help, after many hours of attempting to figure it out, i have up on using 'checkbox' and just copied the code for the meal radio buttons, and got it working..
Many Thanks
Michael
glad you got it working!
Hi,
I would like to say a big thanks for this, over the past few months i have tinkered with the code to suit my needs, but i am no expert when it comes to Python or Django and have winged it with most of the changes in the code, and that is where my Google search skills come to a end.
In the invitation.html file i have added a checkbox for if the guest requires a bus to/from the venue, which does show up in the page, but i have no idea on how to save the details into the database and to show the checkbox if the guest reloads the invitation page
guests/templates/guests/invitation.html
guests/models.py
guests/migrations/0022_req_bus.py
Any help would be greatly appreciated,
Thanks
Michael