Description
Soon we will introduce new fields to store the Journalist profile URL in many more social networks, a large number of Journalists with a low number of profile links defined will produce an inefficient storage result (table with mostly null values in its cells), the proposal here is to use a new model SocialNetwork
with all the columns we want, but 2 of these must be: "order" (to present profile links in that order) and "enabled" (to enable/disable the render of profiles links of the social network). Then, a M2M relation implemented with a new field in core.Journalist: social_networks = ManyToMany(SocialNetwork, through=SocialNetworkProfileLink)
through another new model (SocialNetworkProfileLink
) with a single not nullable profile_url = URLField
field to store the profile link of the relation.
For the Journalist model admin implemenation change, use a tabular inline with no extra rows (new blank rows to fill will only appear when its button or link is clicked)
Important: the solution must come also with the data migration script to migrate existing data to the new layout