I am used to programming in PHP and Postgres/MySQL and I am struggling to get my head around the way that Alpha Five does things.
I understand from the documentation that Alpha Five can't display a form or browse for a many-to-many to set, which makes perfect sense, but I don't know how to access/display my data in the way that I want to.
Firstly, my data.
As a learning exercise, I am writing a small application that stores the birthdays of friends and family, and sends email(s) just before their birthday, to one or more email addresses.
So I have two main tables - birthdate and email - and a joining table birthdate_email, because each birthday reminder can be sent to more than one email address, and each email address can be notified of more than one birthday. Birthdate has fields for id, name, birthdate and next birthday, while email has fields for id and email address. Birthdate_email has two fields - birthdate id and email id.
Secondly, my interface.
What I have so far is a form with a summary of names and birthdates (as an embedded browse of the birthdates table), from which you can select one record to edit (or add a new one), which opens up a new form, based on one record from the birthdate table.
What I want to see is, after the person's name and birthdate details, is a set of checkboxes, one for each email address in the email table.
What I would previously have done, as a conceptual design is:
1. Queried the email table to return a list/array of all possible email addresses
2. Displayed all of those email addresses, associated with a checkbox
3. Queried the birthdate_email table with the current birthdate_id to return a list of email addresses currently set to be notified about this particular birthdate
4. Marked each of those email addresses as 'checked', and left the remaining email addresses 'unchecked'
Then when someone checked or unchecked one of those email addresses and saved their changes, this would add or remove records from the birthdate_email table appropriately (or alternatively, mark an extra 'status' field in the birthdate_table against that record as 'inactive' to avoid actually deleting records).
I just can't get my head around how to achieve this in Alpha Five.
I realise that my data is fully normalised, and that I could denormalise it a bit which might make it easier (for example, make email_id in birthdate_email a lookup field instead, and possibly get rid of the email table altogether), but this type of data structure is going to come up again and again in the main application I want to build in Alpha Five and I need to crack this nut to feel confident that I can do what I want to in Alpha Five.
How do I connect my data to my interface to get the desired result?
Can anyone get me started in the right direction?
I understand from the documentation that Alpha Five can't display a form or browse for a many-to-many to set, which makes perfect sense, but I don't know how to access/display my data in the way that I want to.
Firstly, my data.
As a learning exercise, I am writing a small application that stores the birthdays of friends and family, and sends email(s) just before their birthday, to one or more email addresses.
So I have two main tables - birthdate and email - and a joining table birthdate_email, because each birthday reminder can be sent to more than one email address, and each email address can be notified of more than one birthday. Birthdate has fields for id, name, birthdate and next birthday, while email has fields for id and email address. Birthdate_email has two fields - birthdate id and email id.
Secondly, my interface.
What I have so far is a form with a summary of names and birthdates (as an embedded browse of the birthdates table), from which you can select one record to edit (or add a new one), which opens up a new form, based on one record from the birthdate table.
What I want to see is, after the person's name and birthdate details, is a set of checkboxes, one for each email address in the email table.
What I would previously have done, as a conceptual design is:
1. Queried the email table to return a list/array of all possible email addresses
2. Displayed all of those email addresses, associated with a checkbox
3. Queried the birthdate_email table with the current birthdate_id to return a list of email addresses currently set to be notified about this particular birthdate
4. Marked each of those email addresses as 'checked', and left the remaining email addresses 'unchecked'
Then when someone checked or unchecked one of those email addresses and saved their changes, this would add or remove records from the birthdate_email table appropriately (or alternatively, mark an extra 'status' field in the birthdate_table against that record as 'inactive' to avoid actually deleting records).
I just can't get my head around how to achieve this in Alpha Five.
I realise that my data is fully normalised, and that I could denormalise it a bit which might make it easier (for example, make email_id in birthdate_email a lookup field instead, and possibly get rid of the email table altogether), but this type of data structure is going to come up again and again in the main application I want to build in Alpha Five and I need to crack this nut to feel confident that I can do what I want to in Alpha Five.
How do I connect my data to my interface to get the desired result?
Can anyone get me started in the right direction?
Comment