This extends the Association dataclass to hold two additional attributes: url and relatedTags. While the url is a simple string field in the db, the relatedTags are stored as a relation between the Association and the Tag.
Since Associations were embedded inside Events as well as UserProfile data classes, this would have meant fetching all the Tags related to the Associations whenever we want a UserProfile (or an Event). To be precise, we talk about multiple four-way nested joins across a total of 8 tables to fetch a UserProfile. In order to simplify this, together with @octogradiste we decided to not embed Associations in Events and UserProfiles anymore. Instead we just embed a simplified object, called AssociationHeader, only containing the id and the name of the Association, analogous to how we already do it for the EventCreator on Events.
closes #264
This extends the Association dataclass to hold two additional attributes:
url
andrelatedTags
. While the url is a simple string field in the db, the relatedTags are stored as a relation between the Association and the Tag. Since Associations were embedded inside Events as well as UserProfile data classes, this would have meant fetching all the Tags related to the Associations whenever we want a UserProfile (or an Event). To be precise, we talk about multiple four-way nested joins across a total of 8 tables to fetch a UserProfile. In order to simplify this, together with @octogradiste we decided to not embed Associations in Events and UserProfiles anymore. Instead we just embed a simplified object, calledAssociationHeader
, only containing the id and the name of the Association, analogous to how we already do it for theEventCreator
on Events.