The date of birth (dob) for an end user is not something that is typically populated by Q2, and it is not included on the incoming request. There is a dob column on the Q2_User table in the database, but this is often NULL since (as of today at least) Q2 does not have a process for populating that column. To get a date of birth, a core call is typically required.
The suggested workflow for getting the dob is this:
- Using the User DbObject and the user_id in self.online_user.user_id, query the database for the user row.
- Check to see if the dob column is returned and if it is populated (HQ will not send NULL columns in database queries, so use the python function
hasatterto see if the dob was returned) - If the dob was not returned, make a core call to fetch the dob via a demographics call.
- using the User DbObject, update the dob column for the user with the dob that was returned from the core call.
One thing to point out is that the self.online_user.demographic_info is populated from the incoming request, and contains the same information that the self.online_user has. The purpose of this object is for convence, if you needed to update demogrpahic information (which takes a demogrpahic object), you already have an object pre populated with the end users info.