1π
β
Iβm not really clear on how you assign messages to tasks. However, if you need the ability to have multiple elements on each side of a relationship, you should use a ManyToManyField, not a ForeignKey.
Depending on what you are actually doing, you should be able to validate the correct number of messages according to num_of_tweets
β for example, if youβre assigning messages via a form, you can do the validation there.
π€Daniel Roseman
Source:stackexchange.com