design patterns - Django: ForeignKey() or ManyToMany() in this case? Or, other? -
I have a model that is something like this:
class return authorization (models Modod): Custom_id = models.CharField (max_length = 40) class RMAAPILog (models.Model): return_authorization = model. ForeignKey (ReturnAuthorization)
If I delete () / Strong> A return authorization, I can not remove it all RMAAPILog () s
which are related to it in this case they are removed. There may be several attempts to obtain RMA from external APIs (many RMAAPILog ()
s ReturnAuthorization ()
, but only one return authorization () for each Definitely RMAAPILog () because it is an attempt to authenticate specific ReturnAuthorization ()
. What would be better way to do this, or am I thinking all the wrong about it? >
related SO question:
Comments
Post a Comment